solaris-fixes branch: Applied the swap-patch by Christophe Kalt.
[collectd.git] / src / common.c
index 58db4d8..78be3af 100644 (file)
@@ -488,7 +488,7 @@ static int log_create_file (char *filename, char **ds_def, int ds_num)
 
                /* The `%.*s' is needed because there is no null-byte behind
                 * the name. */
-               fprintf(log, ",%.*s", (tmp - name), name);
+               fprintf(log, ",%.*s", (int) (tmp - name), name);
        }
        fprintf(log, "\n");
        fclose(log);
@@ -522,7 +522,7 @@ static int log_update_file (char *host, char *file, char *values,
        strncpy (full_file, file, 1024);
 
        tmp = full_file + strlen (full_file) - 4;
-       assert (tmp > 0);
+       assert ((tmp != NULL) && (tmp > full_file));
 
        /* Change the filename for logfiles. */
        if (strncmp (tmp, ".rrd", 4) == 0)