Parcourir la source

test_physfs: fix -Werror=stringop-truncation error

specified bound 64 equals destination size
Anonymous Maarten il y a 3 mois
Parent
commit
2ddc65739a
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      test/test_physfs.c

+ 2 - 2
test/test_physfs.c

@@ -1335,12 +1335,12 @@ static int cmd_write(char *args)
 static char* modTimeToStr(PHYSFS_sint64 modtime, char *modstr, size_t strsize)
 {
     if (modtime < 0)
-        strncpy(modstr, "Unknown\n", strsize);
+        strncpy(modstr, "Unknown\n", strsize - 1);
     else
     {
         time_t t = (time_t) modtime;
         char *str = ctime(&t);
-        strncpy(modstr, str, strsize);
+        strncpy(modstr, str, strsize - 1);
     } /* else */
 
     modstr[strsize-1] = '\0';