X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=utf8.c;h=a10a11aaa8cab039b6efda1a2b4ed457f0c733eb;hp=391fc0951d34ba89e275940ef4ef9000f5a09c28;hb=69b55ccc03b56af1f6c05eb45866ab198307487f;hpb=d6e7d8ca758e3ce16383b1f79a081e12ab130efc diff --git a/utf8.c b/utf8.c index 391fc09..a10a11a 100644 --- a/utf8.c +++ b/utf8.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 + * Copyright (C) 2012, 2013 * Wolfgang Bumiller * * Permission is hereby granted, free of charge, to any person obtaining a copy of @@ -198,7 +198,7 @@ uchar_t u8_getchar(const char *_s, const char **_end) if (!u8_analyze(_s, &st, &ln, &ch, 0x10)) ch = 0; - if (_end) + else if (_end) *_end = _s + st + ln; return ch; } @@ -210,7 +210,7 @@ uchar_t u8_getnchar(const char *_s, const char **_end, size_t _maxlen) if (!u8_analyze(_s, &st, &ln, &ch, _maxlen)) ch = 0; - if (_end) + else if (_end) *_end = _s + st + ln; return ch; }