use GNUNET_strlcpy in strings.c too
authorlurchi <lurchi@strangeplace.net>
Thu, 27 Jun 2019 09:04:15 +0000 (11:04 +0200)
committerlurchi <lurchi@strangeplace.net>
Thu, 27 Jun 2019 09:41:06 +0000 (11:41 +0200)
src/util/strings.c

index d69244e831f361dd8b892f2efeb4887af30216dd..ae05442967afb8db4d1de01e7cffd22f76f708bb 100644 (file)
@@ -826,8 +826,7 @@ GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t)
         (uint8_t *) buf, &ssize);
     if (conved != (uint8_t *) buf)
     {
-      strncpy (buf, (char *) conved, sizeof (buf));
-      buf[255 - 1] = '\0';
+      GNUNET_strlcpy (buf, (char *) conved, sizeof (buf));
       free (conved);
     }
   }