tekhex.c tidy writesym

Simplifies the code a little.  No functional changes.
This commit is contained in:
Alan Modra 2024-10-24 18:14:52 +10:30
parent 6ecc44f698
commit b3ee98cda4

View File

@ -736,22 +736,14 @@ writesym (char **dst, const char *sym)
int len = (sym ? strlen (sym) : 0);
if (len >= 16)
len = 16;
else if (len == 0)
{
*p++ = '0';
len = 16;
}
else
{
if (len == 0)
{
*p++ = '1';
sym = "$";
len = 1;
}
else
*p++ = digs[len];
len = 1;
sym = "$";
}
*p++ = digs[len & 0xf];
while (len--)
*p++ = *sym++;