Fix bug about string input
authorcc <ch79.cho@samsung.com>
Fri, 2 Sep 2016 11:35:26 +0000 (20:35 +0900)
committerUze Choi <uzchoi@samsung.com>
Fri, 2 Sep 2016 12:57:11 +0000 (12:57 +0000)
Unexpected topic message is set by fgets operation.

Change-Id: I4a7ac3d1a91baa0025426967fb54a13d3f58156d
Signed-off-by: cc <ch79.cho@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11341
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
service/notification/examples/linux/notificationprovider.c

index 8076992..c643fcf 100644 (file)
@@ -222,13 +222,13 @@ int main()
 
                 printf("id : %d\n", ++id);
                 printf("title : ");
-                fgets(title, sizeof(title), stdin);
+                gets(title);
 
                 printf("body : ");
-                fgets(body, sizeof(body), stdin);
+                gets(body);
 
                 printf("topic : ");
-                fgets(topic, sizeof(topic), stdin);
+                gets(topic);
 
                 printf("app - mTitle : %s \n", title);
                 printf("app - mContentText : %s \n", body);