diff options
-rw-r--r-- | 2.3-1/jar/scilab_en_US_help.jar | bin | 11210 -> 11210 bytes | |||
-rw-r--r-- | 2.3-1/src/c/string/strcspn/gstrcspna.c | 27 |
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 Binary files differindex 42fc9ad4..5ab633f5 100644 --- a/2.3-1/jar/scilab_en_US_help.jar +++ b/2.3-1/jar/scilab_en_US_help.jar 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; } |