]> sigrok.org Git - libsigrok.git/blobdiff - src/strutil.c
scpi: Make helper functions from scpi-pps available library-wide.
[libsigrok.git] / src / strutil.c
index 050f37bf7090532cc67282e07c10ce2867a985b6..bb5913f392ca434aa15407f436f74746815201d0 100644 (file)
@@ -21,8 +21,9 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <errno.h>
-#include "libsigrok.h"
+#include <libsigrok/libsigrok.h>
 #include "libsigrok-internal.h"
 
 /** @cond PRIVATE */
@@ -246,7 +247,7 @@ SR_API char *sr_si_string_u64(uint64_t x, const char *unit)
        const char *p, prefix[] = "\0kMGTPE";
        char fmt[16], fract[20] = "", *f;
 
-       if (unit == NULL)
+       if (!unit)
                unit = "";
 
        for (i = 0; (quot = x / divisor[i]) >= 1000; i++);