daemon: Missing #includes revealed by cross-compiling.
[libguestfs.git] / daemon / ext2.c
index 0021a06..f46bac9 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "../src/guestfs_protocol.h"
@@ -48,7 +49,7 @@ do_tune2fs_l (const char *device)
   p = out;
 
   /* Discard the first line if it contains "tune2fs ...". */
-  if (strncmp (p, "tune2fs ", 8) == 0) {
+  if (STREQLEN (p, "tune2fs ", 8)) {
     p = strchr (p, '\n');
     if (p) p++;
     else {
@@ -78,9 +79,9 @@ do_tune2fs_l (const char *device)
         free (out);
         return NULL;
       }
-      if (strcmp (colon, "<none>") == 0 ||
-          strcmp (colon, "<not available>") == 0 ||
-          strcmp (colon, "(none)") == 0) {
+      if (STREQ (colon, "<none>") ||
+          STREQ (colon, "<not available>") ||
+          STREQ (colon, "(none)")) {
         if (add_string (&ret, &size, &alloc, "") == -1) {
           free (out);
           return NULL;