Skip to content
Snippets Groups Projects
Commit 985e2052 authored by rswindell's avatar rswindell
Browse files

Optimized/modernized remove_ctrl_a() a little.

parent 61d925c4
No related branches found
No related tags found
No related merge requests found
...@@ -47,14 +47,14 @@ const char *mon[]={"Jan","Feb","Mar","Apr","May","Jun" ...@@ -47,14 +47,14 @@ const char *mon[]={"Jan","Feb","Mar","Apr","May","Jun"
char* DLLCALL remove_ctrl_a(char *instr, char *outstr) char* DLLCALL remove_ctrl_a(char *instr, char *outstr)
{ {
char str[1024],*p; char str[1024],*p;
uint i,j,k; uint i,j;
j=strlen(instr); for(i=j=0;instr[i];i++) {
for(k=i=0;i<j;i++) {
if(instr[i]==CTRL_A) if(instr[i]==CTRL_A)
i++; i++;
else str[k++]=instr[i]; } else str[j++]=instr[i];
str[k]=0; }
str[j]=0;
if(outstr!=NULL) if(outstr!=NULL)
p=outstr; p=outstr;
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment