Follow up on #1714

* Changed sprintf to ogs_snprintf

* Limited to 80 column
This commit is contained in:
Sukchan Lee 2022-08-25 16:35:27 +09:00
parent 49349cdb75
commit 83a20b82c7
4 changed files with 48 additions and 28 deletions

View file

@ -54,15 +54,16 @@ void *ogs_ascii_to_hex(char *in, int in_len, void *out, int out_len)
void *ogs_hex_to_ascii(void *in, int in_len, void *out, int out_len)
{
char *p;
char *p, *last;
int i = 0, l, off = 0;
p = out;
last = p + out_len;
p[0] = 0;
l = (in_len - off) > out_len ? out_len : in_len - off;
for (i = 0; i < l; i++) {
p += sprintf(p, "%02x", ((char*)in)[off+i] & 0xff);
p = ogs_slprintf(p, last, "%02x", ((char*)in)[off+i] & 0xff);
}
return out;