From 80f28fa1d04700d0813a99df57de27039d236e26 Mon Sep 17 00:00:00 2001 From: Ankitr19 Date: Wed, 12 Jul 2017 20:44:33 +0530 Subject: strcspn error removed --- src/c/string/strcspn/gstrcspna.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'src/c') diff --git a/src/c/string/strcspn/gstrcspna.c b/src/c/string/strcspn/gstrcspna.c index 2c83c72..91de8af 100644 --- a/src/c/string/strcspn/gstrcspna.c +++ b/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;mtp) + { + ind=tp; + } + } } - } } - return (ind+1); + if(ind==size1+1) + { + ind=size1; + } + return ind; } -- cgit