changeset 73:e37d7c1f8a03

Using strncmp() for long argument comparision with length of the option being checked against is not that smart, as it will sometimes match similarly prefixed long arguments incorrectly. Fixed.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 18 Nov 2012 23:12:33 +0200
parents 34d58b0f2d52
children 8ff993207415
files th_args.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/th_args.c	Mon Nov 12 20:54:03 2012 +0200
+++ b/th_args.c	Sun Nov 18 23:12:33 2012 +0200
@@ -226,7 +226,7 @@
         if (optList[i].optLong)
         {
             optLen = strlen(optList[i].optLong);
-            if (strncmp(currArg, optList[i].optLong, optLen) == 0)
+            if (strcmp(currArg, optList[i].optLong) == 0)
                 optN = i;
         }