summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2014-04-10 01:29:01 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2014-04-10 01:29:01 +0300
commit9fda2cdb2f031c61d125ab2f8684a143ed868b51 (patch)
tree29c2afff78c38e7c35dedac2f531790cea190f4e /client
parent2615c43dc052617312ea102ab2a50cb449d9827b (diff)
downloadbemenu-9fda2cdb2f031c61d125ab2f8684a143ed868b51.tar.gz
bemenu-9fda2cdb2f031c61d125ab2f8684a143ed868b51.tar.bz2
bemenu-9fda2cdb2f031c61d125ab2f8684a143ed868b51.zip
Fix static analyze errors.
Diffstat (limited to 'client')
-rw-r--r--client/client.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/client/client.c b/client/client.c
index 2b2bb68..df56511 100644
--- a/client/client.c
+++ b/client/client.c
@@ -32,8 +32,11 @@ static ptrdiff_t getLine(char **outLine, size_t *outAllocated, FILE *stream)
}
for (s = buffer;;) {
- if (fgets(s, allocated - (s - buffer), stream) == NULL)
+ if (fgets(s, allocated - (s - buffer), stream) == NULL) {
+ *outAllocated = allocated;
+ *outLine = buffer;
return -1;
+ }
len = strlen(s);
if (feof(stream))
@@ -68,7 +71,7 @@ static ptrdiff_t getLine(char **outLine, size_t *outAllocated, FILE *stream)
static void readItemsToMenuFromStdin(bmMenu *menu)
{
ptrdiff_t len;
- size_t size;
+ size_t size = 0;
char *line = NULL;
while ((len = getLine(&line, &size, stdin)) != -1) {