From 5a4df56a9c6eba36b56e9ffd042674b9255720ac Mon Sep 17 00:00:00 2001 From: Baptiste DURAND Date: Wed, 29 Oct 2014 12:20:09 +0100 Subject: Usage strcpy instead of strncpy. Sometimes strncpy seems to have strange behavior BUG=XWALK-2800 Change-Id: Idf11bb372e384fb23835b2a062a46d6ca0853ab1 Signed-off-by: Baptiste DURAND --- app_launcher.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app_launcher.c b/app_launcher.c index f59d1a42..45f40c71 100755 --- a/app_launcher.c +++ b/app_launcher.c @@ -250,7 +250,11 @@ int main(int argc, char **argv) case 's': case 'k': case 'r': - strncpy(args.applicationId, optarg, strlen(optarg)); + if(strlen(optarg) > 255) { + print_usage(argv[0]); + return -1; + } else + strcpy(args.applicationId, optarg); op = next_opt; break; -- cgit v1.2.3