From: Luiz Augusto von Dentz <luiz.von.de...@intel.com> make[3]: Entering directory `/home/vudentz/git/openobex/apps/obex_test' CC obex_test_client.o obex_test_client.c: In function ‘push_client’: obex_test_client.c:229:6: error: variable ‘num’ set but not used obex_test_client.c: In function ‘put_client’: obex_test_client.c:290:6: error: variable ‘num’ set but not used obex_test_client.c: In function ‘get_client’: obex_test_client.c:347:6: error: variable ‘num’ set but not used obex_test_client.c: In function ‘setpath_client’: obex_test_client.c:418:6: error: variable ‘num’ set but not used cc1: all warnings being treated as errors --- apps/obex_test/obex_test_client.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/apps/obex_test/obex_test_client.c b/apps/obex_test/obex_test_client.c index 0bf5d42..fc54e20 100644 --- a/apps/obex_test/obex_test_client.c +++ b/apps/obex_test/obex_test_client.c @@ -235,6 +235,11 @@ void push_client(obex_t *handle) printf("PUSH filename> "); num = scanf("%s", fname); + if (num != 1) { + perror("scanf"); + return; + } + bfname = strdup(basename(fname)); buf = easy_readfile(fname, &file_size); @@ -294,6 +299,11 @@ void put_client(obex_t *handle) printf("PUT file (local, remote)> "); num = scanf("%s %s", lname, rname); + if (num != 2) { + perror("scanf:"); + return; + } + buf = easy_readfile(lname, &file_size); if(buf == NULL) { @@ -349,6 +359,10 @@ void get_client(obex_t *handle, struct context *gt) printf("GET File> "); num = scanf("%s", req_name); + if (num != 1) { + perror("scanf:"); + return; + } if(! (object = OBEX_ObjectNew(handle, OBEX_CMD_GET))) { printf("Error\n"); @@ -420,6 +434,10 @@ void setpath_client(obex_t *handle) printf("SETPATH> "); num = scanf("%s", path); + if (num != 1) { + perror("scanf:"); + return; + } if(! (object = OBEX_ObjectNew(handle, OBEX_CMD_SETPATH))) { printf("Error\n"); -- 1.7.5.1 ------------------------------------------------------------------------------ vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 _______________________________________________ Openobex-users mailing list Openobex-users@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/openobex-users