You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
805 B

  1. From 8d2ed4c959039abdcfeaa3fe1e70af0e75be8809 Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Sun, 11 Oct 2020 22:02:23 -0700
  4. Subject: [PATCH] jcat: remove bzero
  5. bzero is removed in POSIX 2008. malloc/bzero can also be replaced with
  6. calloc.
  7. Signed-off-by: Rosen Penev <rosenp@gmail.com>
  8. ---
  9. jcat.c | 4 +---
  10. 1 file changed, 1 insertion(+), 3 deletions(-)
  11. diff --git a/jcat.c b/jcat.c
  12. index 8335d6e..81ffe04 100644
  13. --- a/jcat.c
  14. +++ b/jcat.c
  15. @@ -644,12 +644,10 @@ int main(int argc, char *argv[])
  16. struct jcat_priv *priv;
  17. int ret;
  18. - priv = malloc(sizeof(*priv));
  19. + priv = calloc(1, sizeof(*priv));
  20. if (!priv)
  21. err(EXIT_FAILURE, "can't allocate priv");
  22. - bzero(priv, sizeof(*priv));
  23. -
  24. priv->todo_prio = -1;
  25. priv->infile = STDIN_FILENO;
  26. priv->outfile = STDOUT_FILENO;