]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - utf8.c
gitignore: add gmqcc, gmqpak, qmcvm, testsuite, pak.
[xonotic/gmqcc.git] / utf8.c
diff --git a/utf8.c b/utf8.c
index 391fc0951d34ba89e275940ef4ef9000f5a09c28..a10a11aaa8cab039b6efda1a2b4ed457f0c733eb 100644 (file)
--- 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;
 }