vnote: replace st00pid uses of strcpy
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 21 Oct 2012 20:59:29 +0000 (22:59 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 21 Oct 2012 20:59:29 +0000 (22:59 +0200)
libcitadel/lib/vnote.c

index c8f45b98c83e8ae5a3acab88ac28c8aeb3c58ef9..feeee928915a3bf008e71d6a112ec3364760700e 100644 (file)
@@ -212,7 +212,7 @@ void vnote_serialize_output_field(char *append_to, char *field, char *label) {
 
        mydup = malloc((strlen(field) * 3) + 1);
        if (!mydup) return;
-       strcpy(mydup, "");
+       *mydup = '\0';
 
        while (ptr[pos] != 0) {
                ch = (unsigned char)(ptr[pos++]);
@@ -255,7 +255,7 @@ char *vnote_serialize(struct vnote *v) {
        s = malloc(bytes_needed);
        if (!s) return NULL;
 
-       strcpy(s, "");
+       *s = '\0';
        vnote_serialize_output_field(s, "vnote", "BEGIN");
        vnote_serialize_output_field(s, "//Citadel//vNote handler library//EN", "PRODID");
        vnote_serialize_output_field(s, "1.1", "VERSION");