]> granicus.if.org Git - fortune-mod/commitdiff
elim -D_FORTIFY_SOURCE warnings.
authorShlomi Fish <shlomif@shlomifish.org>
Sat, 4 Apr 2020 17:49:43 +0000 (20:49 +0300)
committerShlomi Fish <shlomif@shlomifish.org>
Sat, 4 Apr 2020 17:49:43 +0000 (20:49 +0300)
fortune-mod/fortune/fortune.c

index a35156a78394c904f601acd680b93f7a82719c0d..80842ab9bf6b0571fa29bdd853b9d9e47264c77f 100644 (file)
@@ -708,11 +708,8 @@ static int add_file(int percent, register const char *file, const char *dir,
     fp->fd = fd;
     fp->percent = percent;
 
-    fp->name = do_malloc(strlen(file) + (size_t)1);
-    strncpy(fp->name, file, strlen(file) + (size_t)1);
-
-    fp->path = do_malloc(strlen(path) + (size_t)1);
-    strncpy(fp->path, path, strlen(path) + 1UL);
+    fp->name = strdup(file);
+    fp->path = strdup(path);
 
     // FIXME
     fp->utf8_charset = FALSE;