freecwmp
[Top] [All Lists]

[PATCH] fix implicit declaration of memset and dangling pointer

To: luka@openwrt.org
Subject: [PATCH] fix implicit declaration of memset and dangling pointer
From: rajsek <miran.rajsek@gmail.com>
Date: Wed, 20 Feb 2013 10:58:48 +0100
Cc: freecwmp@linux-mips.org, rajsek <miroslav.rajsek@innbox.net>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:signed-off-by; bh=qzY3YGwC2oBBfsrKHm0eVB9q7EnF8oYlpfhShkCqFz4=; b=bAx6OIjHvru3uq7X2+OWMy6bAN0EnJqcfE1q103uWniFG2noInD41ExMqZc4QQknTq xvTTWyHOv1q00ytEZpO6pN88WlnyY47zwq6t0+/n3n3Q5aths81XiTnF/4TZbCR2qYp1 uhJEe7G0KoPQgAdBEIe9T7Hj6ERHEf25GCXUxXtw4ajP5ZUCzOpD2BzUSzmyfEyjvU6j KLApUMtGlop1E9IfIqB/suwHIE96GHrCM+gkiS4Q2XpKGdmEkkOSA/ncSQMeA/+rZp+P /KR2ulGUMMgXQuJps52iCdAHA7LY9SdpYd3/AzIPExx/C4BHrI5hJvoO2BcyCcswmUzV o3Mw==
In-reply-to: <1361354328-2719-1-git-send-email-rajsek@iskratel.si>
Original-recipient: rfc822;freecwmp@linux-mips.org
References: <1361354328-2719-1-git-send-email-rajsek@iskratel.si>
Sender: freecwmp-bounce@linux-mips.org
Signed-off-by: rajsek <miroslav.rajsek@innbox.net>
From: rajsek <miroslav.rajsek@innbox.net>

---
 src/freecwmp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/freecwmp.c b/src/freecwmp.c
index 5c36574..9f3d0d3 100644
--- a/src/freecwmp.c
+++ b/src/freecwmp.c
@@ -12,6 +12,7 @@
 #include <stdio.h>
 #include <syslog.h>
 #include <time.h>
+#include <string.h>
 
 #include "libfreecwmp.h"
 
@@ -128,7 +129,7 @@ char * lfc_get_current_time(char *format)
        tm_c = localtime(&time_c);
        if (tm_c == NULL) return NULL;
 
-       char buf[BUFSIZ];
+       static char buf[BUFSIZ];
        memset(buf, 0, BUFSIZ);
 
        if (strftime(buf, sizeof(buf), format, tm_c) == 0) return NULL;
-- 
1.7.0.4


<Prev in Thread] Current Thread [Next in Thread>