RPS utils: Use proper size for writing to file
authorJulius Bünger <buenger@mytum.de>
Thu, 25 Oct 2018 12:49:12 +0000 (14:49 +0200)
committerJulius Bünger <buenger@mytum.de>
Mon, 29 Oct 2018 17:05:48 +0000 (18:05 +0100)
src/rps/rps-test_util.h

index 11093420e8b86357bc4f07cbec1aafd408ff93da..a806f11cdc2c84de720d6434f834da6df0ed6b1c 100644 (file)
@@ -49,7 +49,7 @@ create_file (const char *name);
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
            "Failed to create tmp_buf\n");\
     else\
-      GNUNET_DISK_fn_write(file_name,tmp_buf, sizeof(tmp_buf),\
+      GNUNET_DISK_fn_write(file_name, tmp_buf, strnlen(tmp_buf, 512),\
                             GNUNET_DISK_PERM_USER_READ |\
                             GNUNET_DISK_PERM_USER_WRITE |\
                             GNUNET_DISK_PERM_GROUP_READ |\
@@ -64,7 +64,7 @@ create_file (const char *name);
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
            "Failed to create tmp_buf\n");\
     else\
-      GNUNET_DISK_fn_write(file_name,tmp_buf, len, \
+      GNUNET_DISK_fn_write(file_name, tmp_buf, strnlen(tmp_buf, len), \
                             GNUNET_DISK_PERM_USER_READ |\
                             GNUNET_DISK_PERM_USER_WRITE |\
                             GNUNET_DISK_PERM_GROUP_READ |\