diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/client.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/client/client.c b/client/client.c index 8bc4be1..2f95d52 100644 --- a/client/client.c +++ b/client/client.c @@ -28,13 +28,15 @@ static void readItemsToMenuFromStdin(bmMenu *menu) size_t pos; char *s = buffer; while ((pos = strcspn(s, "\n")) != 0) { + size_t next = pos + (s[pos] != 0); s[pos] = 0; + bmItem *item = bmItemNew(s); if (!item) break; bmMenuAddItem(menu, item); - s += pos + 1; + s += next; } free(buffer); |