M
Mike Copeland
I have a number of functions similar to the code below that are
starting to cause problems when incoming data exceeds the limit (e.g.
1024) imposed by the code. Rather than select another arbitrary limit
and have the problem occur later when larger data appears, I'd like to
fix the issue the right way. I'm unsure how to do this...
Please advise. TIA
char* TextFunctions::removeCR(char *s) // Remove C/R from data string
{
static char w[1024];
int n;
char *p;
strcpy (w, s);
n = strlen(w);
p = strrchr(w, char(10));
if(p) w[p-w] = '\0';
return w;
} // remove CR
starting to cause problems when incoming data exceeds the limit (e.g.
1024) imposed by the code. Rather than select another arbitrary limit
and have the problem occur later when larger data appears, I'd like to
fix the issue the right way. I'm unsure how to do this...
Please advise. TIA
char* TextFunctions::removeCR(char *s) // Remove C/R from data string
{
static char w[1024];
int n;
char *p;
strcpy (w, s);
n = strlen(w);
p = strrchr(w, char(10));
if(p) w[p-w] = '\0';
return w;
} // remove CR