chiark / gitweb /
shared/socket-util: kill gcc warning about uninitialized variable
[elogind.git] / src / delta / delta.c
index eef6536b01f0897d9d182bc50d0f0f01b00e6b2c..494e82eb989c449ee27906da472ae56a6a3ae676 100644 (file)
@@ -176,11 +176,12 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, const char *path) {
         }
 
         for (;;) {
-                struct dirent *de, buf;
+                struct dirent *de;
+                union dirent_storage buf;
                 int k;
                 char *p;
 
-                k = readdir_r(d, &buf, &de);
+                k = readdir_r(d, &buf.de, &de);
                 if (k != 0) {
                         r = -k;
                         goto finish;
@@ -307,7 +308,7 @@ static int process_suffix_chop(const char *prefixes, const char *suffix) {
         /* Strip prefix from the suffix */
         NULSTR_FOREACH(p, prefixes) {
                 if (startswith(suffix, p)) {
-                        suffix += strlen(p);;
+                        suffix += strlen(p);
                         suffix += strspn(suffix, "/");
                         return process_suffix(prefixes, suffix);
                 }