aboutsummaryrefslogtreecommitdiff
path: root/dpid/dpidc.c
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2010-02-02 21:23:08 +0100
committerJorge Arellano Cid <jcid@dillo.org>2010-02-02 21:23:08 +0100
commit9ba93c4cf8ca7fdc6384f39ac67cdaa2e4e5f636 (patch)
treec9146b8454045646655b9dc844c7a00da2534ceb /dpid/dpidc.c
parented744a37a3d1e5d9081c08c9993d60db71b7315a (diff)
check for fgets() return value - avoids a warning
Diffstat (limited to 'dpid/dpidc.c')
-rw-r--r--dpid/dpidc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dpid/dpidc.c b/dpid/dpidc.c
index 971281d5..2d3c716f 100644
--- a/dpid/dpidc.c
+++ b/dpid/dpidc.c
@@ -98,7 +98,8 @@ int main(int argc, char *argv[])
} else if (strcmp(argv[1], "chat") == 0) {
printf("Please enter the message: ");
bzero(buffer,256);
- fgets(buffer,255,stdin);
+ if (fgets(buffer,255,stdin) == NULL)
+ MSG_ERR("dpidc: Can't read the message\n");
} else {
MSG_ERR("main: Unknown operation '%s'\n", argv[1]);
print_usage(argv[0]);