aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2005-01-10 19:55:14 +0000
committerJason Woodward2005-01-10 19:55:14 +0000
commit91d7da28050cada477dd04a5745fafccda6086e8 (patch)
tree9b47adf6134b051f762694611a05fe83b2974330 /src
parent246039720152b6846539e346535bb3461a3dadc4 (diff)
downloadslapt-get-91d7da28050cada477dd04a5745fafccda6086e8.tar.gz
moved strlen out of for loop
Diffstat (limited to 'src')
-rw-r--r--src/common.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common.c b/src/common.c
index 36b70cb..108c7c1 100644
--- a/src/common.c
+++ b/src/common.c
@@ -214,10 +214,11 @@ int ask_yes_no(const char *format, ...)
}
char *str_replace_chr(const char *string,const char find, const char replace){
- int i;
+ unsigned int i,len = 0;
char *clean = calloc( strlen(string) + 1, sizeof *clean);;
- for(i = 0;i < (int)strlen(string);i++){
+ len = strlen(string);
+ for(i = 0;i < len; ++i){
if(string[i] == find ){
clean[i] = replace;
}else{