From: H. Peter Anvin Date: Tue, 19 Feb 2008 22:08:06 +0000 (-0800) Subject: refstr_get(): handle NULL, force inline X-Git-Tag: syslinux-3.62-pre11~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97880e0237a80d76453d722aaa2912417a037f1b;p=platform%2Fupstream%2Fsyslinux.git refstr_get(): handle NULL, force inline Make refstr_get() handle NULL correctly; force it to be an inline since it seems to make no difference for code size. --- diff --git a/com32/menu/refstr.h b/com32/menu/refstr.h index 593b0ab..8bec018 100644 --- a/com32/menu/refstr.h +++ b/com32/menu/refstr.h @@ -22,10 +22,11 @@ #include #include -static inline const char *refstr_get(const char *r) +static inline __attribute__((always_inline)) +const char *refstr_get(const char *r) { - unsigned int *ref = (unsigned int *)r - 1; - ref++; + if (r) + ((unsigned int *)r)[-1]++; return r; }