* Bug #13298 fixed - Static analysis bugs detected by PVS-Studio fixed
[scilab.git] / scilab / modules / completion / src / c / getCommonPart.c
index 1bfa0a8..1429067 100644 (file)
 #include "getCommonPart.h"
 #include "core_math.h"
 #include "sci_malloc.h"
-#include "os_strdup.h"
+#include "os_string.h"
 /*--------------------------------------------------------------------------*/
 static int cmp( const void *a , const void *b)
 {
-    return strcmp(*(const char **)a, *(const char **)b );
+    return strcmp(*(char**)a, *(char**)b );
 }
 /*--------------------------------------------------------------------------*/
 static int cmpPos(char *str1, char *str2)
@@ -74,7 +74,7 @@ char *getCommonPart(char **dictionary, int sizeDictionary)
         int i = 0;
         int r = 0;
         char *currentstr = dictionary[0];
-        qsort(dictionary, sizeof dictionary / sizeof dictionary[0], sizeof dictionary[0], cmp);
+        qsort(dictionary, sizeDictionary, sizeof dictionary[0], cmp);
 
         r = cmpPos(currentstr, dictionary[1]);
         for (i = 1; i < sizeDictionary - 1; i++)