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

Eliminate unnecessary use of strcat().

parent 1c204c1a
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -42,7 +42,6 @@
static char *binstr(uchar *buf, ushort length)
{
static char str[512];
char tmp[128];
int i;
str[0]=0;
......@@ -53,13 +52,13 @@ static char *binstr(uchar *buf, ushort length)
if(i==length) /* not binary */
return((char*)buf);
for(i=0;i<length;i++) {
sprintf(tmp,"%02X ",buf[i]);
strcat(str,tmp);
sprintf(str+strlen(str),"%02X ",buf[i]);
if(i>=100) {
strcat(str,"...");
break;
}
}
truncsp(str);
return(str);
}
......
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