From 5a4df56a9c6eba36b56e9ffd042674b9255720ac Mon Sep 17 00:00:00 2001 From: Baptiste DURAND Date: Wed, 29 Oct 2014 12:20:09 +0100 Subject: [PATCH] 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 f59d1a4..45f40c7 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; -- 2.7.4