commit | f3d45597169db60d15ab911aef027e5851691664 | [log] [tgz] |
---|---|---|
author | Andrew Scull <ascull@google.com> | Thu Sep 20 14:30:22 2018 +0100 |
committer | Andrew Scull <ascull@google.com> | Thu Sep 20 14:31:03 2018 +0100 |
tree | 5fa00292908694461bc8a7992def5641aa58cec5 | |
parent | 8c3a63ab52f71775983f62dd6a94a798677f0511 [diff] [blame] |
Use indexing in preference to pointer arithmetic. Change-Id: Ia90714e95af1e545f626bd5b6c99e40622e37286
diff --git a/src/dlog.c b/src/dlog.c index 7f4e935..7128a7b 100644 --- a/src/dlog.c +++ b/src/dlog.c
@@ -82,7 +82,7 @@ static const char *digits_upper = "0123456789ABCDEFX"; const char *d = (flags & FLAG_UPPER) ? digits_upper : digits_lower; char buf[51]; - char *ptr = buf + sizeof(buf) - 1; + char *ptr = &buf[sizeof(buf) - 1]; char *num; *ptr = '\0'; do {