From: Alan Modra Date: Thu, 24 Oct 2024 07:44:52 +0000 (+1030) Subject: tekhex.c tidy writesym X-Git-Tag: gdb-16-branchpoint~594 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3ee98cda498bb256411c5bc23cf7fb9b17f10db;p=thirdparty%2Fbinutils-gdb.git tekhex.c tidy writesym Simplifies the code a little. No functional changes. --- diff --git a/bfd/tekhex.c b/bfd/tekhex.c index 16e8e185572..aea2ebb23df 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -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++;