patch-gnats_npr-edit_c 519 B

12345678910111213141516
  1. $OpenBSD: patch-gnats_npr-edit_c,v 1.1 2003/08/25 23:35:06 brad Exp $
  2. --- gnats/npr-edit.c.orig Tue Sep 21 17:18:39 1999
  3. +++ gnats/npr-edit.c Wed Jul 2 13:23:13 2003
  4. @@ -92,8 +92,9 @@ int
  5. receive_list (cmd, suff)
  6. char *cmd, *suff;
  7. {
  8. - char *s = (char *) xmalloc (strlen (outname) + 5);
  9. - sprintf (s, "%s%s", outname, suff);
  10. + size_t len = strlen (outname) + 5;
  11. + char *s = (char *) xmalloc (len);
  12. + snprintf (s, len, "%s%s", outname, suff);
  13. outfp = fopen (s, "w");
  14. if (outfp == (FILE *)NULL)
  15. {