From 5c1db9d0e1287c873d180021cf82e89677fe4aa0 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 14 Jul 2014 17:16:39 +0200 Subject: Static Code Analysis : Add check on the return of strtok inside mkfulldir_internal to avoid warning. --- src/Setup/Dir.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Setup/Dir.c b/src/Setup/Dir.c index 7c418c74..a0380ef2 100644 --- a/src/Setup/Dir.c +++ b/src/Setup/Dir.c @@ -73,15 +73,18 @@ mkfulldir_internal (char *path) trail[0] = tokpath[0]; trail[1] = tokpath[1]; trail[2] = '\0'; - strcat (trail, token); - strcat (trail, "\\"); - token = strtok (NULL, "\\/"); if (token) - { /* get share name */ + { strcat (trail, token); strcat (trail, "\\"); + token = strtok (NULL, "\\/"); + if (token) + { /* get share name */ + strcat (trail, token); + strcat (trail, "\\"); + } + token = strtok (NULL, "\\/"); } - token = strtok (NULL, "\\/"); } if (tokpath[1] == ':') -- cgit v1.2.3