chiark / gitweb /
Prep v230: Apply missing upstream fixes and updates (2/8) src/basic.
[elogind.git] / src / basic / parse-util.c
index 29012b837638b059dc8bb533a9da0c732b612382..d0208e93f01a028c6e5880afcb1fb8d79e3b02a4 100644 (file)
@@ -23,7 +23,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-//#include <xlocale.h>
+#if defined(__GLIBC__)
+#  include <xlocale.h>
+#endif // defined(__GLIBC__)
 
 #include "alloc-util.h"
 //#include "extract-word.h"
@@ -507,7 +509,7 @@ int parse_fractional_part_u(const char **p, size_t digits, unsigned *res) {
         s = *p;
 
         /* accept any number of digits, strtoull is limted to 19 */
-        for(i=0; i < digits; i++,s++) {
+        for (i=0; i < digits; i++,s++) {
                 if (*s < '0' || *s > '9') {
                         if (i == 0)
                                 return -EINVAL;