diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-08-26 11:24:01 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-08-26 11:40:51 +0200 |
commit | 2b729e45b44e7d79904f75b32c68afaf98246fa5 (patch) | |
tree | 5346d9524c2b52f69d9df461ceff452dbc82c974 | |
parent | 8201d7c5fc46b3355692731f22f0e8631faf51d4 (diff) | |
download | barebox-2b729e45b44e7d79904f75b32c68afaf98246fa5.tar.gz barebox-2b729e45b44e7d79904f75b32c68afaf98246fa5.tar.xz |
hush: fix compiler warning
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | common/hush.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/common/hush.c b/common/hush.c index 245dedee4d..3624679040 100644 --- a/common/hush.c +++ b/common/hush.c @@ -1412,11 +1412,15 @@ static int parse_stream_outer(struct p_context *ctx, struct in_str *inp, int fla static int parse_string_outer(struct p_context *ctx, const char *s, int flag) { struct in_str input; - char *p = NULL; + char *p; + const char *cp; int rcode; + if ( !s || !*s) return 1; - if (!(p = strchr(s, '\n')) || *++p) { + + cp = strchr(s, '\n'); + if (!cp || *++cp) { p = xmalloc(strlen(s) + 2); strcpy(p, s); strcat(p, "\n"); |