summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkitr192017-07-12 20:44:33 +0530
committerAnkitr192017-07-12 20:44:33 +0530
commit3052ef8a1ddfb6d50984e90b3fbcf54edc9dd74b (patch)
treeeedc40451f8d6be9d31fc367aff039e6c31f2bdb
parente09999991b1417f0984a8324d92f1d477fc42a15 (diff)
downloadScilab2C-3052ef8a1ddfb6d50984e90b3fbcf54edc9dd74b.tar.gz
Scilab2C-3052ef8a1ddfb6d50984e90b3fbcf54edc9dd74b.tar.bz2
Scilab2C-3052ef8a1ddfb6d50984e90b3fbcf54edc9dd74b.zip
strcspn error removed
-rw-r--r--2.3-1/jar/scilab_en_US_help.jarbin11210 -> 11210 bytes
-rw-r--r--2.3-1/src/c/string/strcspn/gstrcspna.c27
2 files changed, 18 insertions, 9 deletions
diff --git a/2.3-1/jar/scilab_en_US_help.jar b/2.3-1/jar/scilab_en_US_help.jar
index 42fc9ad4..5ab633f5 100644
--- a/2.3-1/jar/scilab_en_US_help.jar
+++ b/2.3-1/jar/scilab_en_US_help.jar
Binary files differ
diff --git a/2.3-1/src/c/string/strcspn/gstrcspna.c b/2.3-1/src/c/string/strcspn/gstrcspna.c
index 2c83c724..91de8af7 100644
--- a/2.3-1/src/c/string/strcspn/gstrcspna.c
+++ b/2.3-1/src/c/string/strcspn/gstrcspna.c
@@ -14,19 +14,28 @@
#include "strcspn.h"
uint8 gstrcspna(char *str1,int size1,char *str2,int size2)
{
- int ind,i,j;
- for(i=0;i<=size2;i++)
+ uint8 ind=size1+1;
+ int l,m;
+ for(m=0;m<size2;m++)
{
- for(j=0;j<=size1;j++)
- {
- if(str2[i]==str1[j])
+ int tp;
+ for(l=0;l<size1;l++)
{
- ind=j;
- break;
+ if(str2[m]==str1[l])
+ {
+ tp=l;
+ if(ind>tp)
+ {
+ ind=tp;
+ }
+ }
}
- }
}
- return (ind+1);
+ if(ind==size1+1)
+ {
+ ind=size1;
+ }
+ return ind;
}