No need to initialize the first element of st->string since it was just
authorclaudio <claudio@openbsd.org>
Tue, 11 Jul 2023 12:14:16 +0000 (12:14 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 11 Jul 2023 12:14:16 +0000 (12:14 +0000)
calloc(3)-ed a few lines above.
OK tb@

lib/libc/stdio/open_memstream.c
lib/libc/stdio/open_wmemstream.c

index 7b063e3..af0169f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: open_memstream.c,v 1.9 2023/06/21 13:11:49 claudio Exp $      */
+/*     $OpenBSD: open_memstream.c,v 1.10 2023/07/11 12:14:16 claudio Exp $     */
 
 /*
  * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
@@ -135,7 +135,6 @@ open_memstream(char **pbuf, size_t *psize)
                return (NULL);
        }
 
-       *st->string = '\0';
        st->pos = 0;
        st->len = 0;
        st->pbuf = pbuf;
index 01dd782..fca0b71 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: open_wmemstream.c,v 1.9 2023/06/21 13:11:49 claudio Exp $     */
+/*     $OpenBSD: open_wmemstream.c,v 1.10 2023/07/11 12:14:16 claudio Exp $    */
 
 /*
  * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
@@ -145,7 +145,6 @@ open_wmemstream(wchar_t **pbuf, size_t *psize)
                return (NULL);
        }
 
-       *st->string = L'\0';
        st->pos = 0;
        st->len = 0;
        st->pbuf = pbuf;