]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/normal/charset.c: Move comment to right place.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 12 Jan 2012 21:13:20 +0000 (22:13 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 12 Jan 2012 21:13:20 +0000 (22:13 +0100)
ChangeLog
grub-core/normal/charset.c

index df581a2b4db50daa7cb17de37ab27e31d89bde42..76dea17a9617ac11a4b36a7cc5639b98e80e10c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-01-12  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/normal/charset.c: Move comment to right place.
+
 2012-01-11  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/fs/affs.c (grub_affs_bblock): Revert flags.
index 4d6cbfac071133deb386bc9b132400b2a54c7f4e..2b82466622df6901fbe7f0c09a5c14baad958a4e 100644 (file)
   Most underline diacritics aren't displayed in gfxterm
  */
 
-/* Convert a (possibly null-terminated) UTF-8 string of at most SRCSIZE
-   bytes (if SRCSIZE is -1, it is ignored) in length to a UTF-16 string.
-   Return the number of characters converted. DEST must be able to hold
-   at least DESTSIZE characters. If an invalid sequence is found, return -1.
-   If SRCEND is not NULL, then *SRCEND is set to the next byte after the
-   last byte used in SRC.  */
-
 #include <grub/charset.h>
 #include <grub/mm.h>
 #include <grub/misc.h>
@@ -67,6 +60,7 @@ grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
     {
       if ((c & GRUB_UINT8_2_LEADINGBITS) != GRUB_UINT8_1_LEADINGBIT)
        {
+         *count = 0;
          /* invalid */
          return 0;
        }
@@ -105,6 +99,12 @@ grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
   return 0;
 }
 
+/* Convert a (possibly null-terminated) UTF-8 string of at most SRCSIZE
+   bytes (if SRCSIZE is -1, it is ignored) in length to a UTF-16 string.
+   Return the number of characters converted. DEST must be able to hold
+   at least DESTSIZE characters. If an invalid sequence is found, return -1.
+   If SRCEND is not NULL, then *SRCEND is set to the next byte after the
+   last byte used in SRC.  */
 grub_ssize_t
 grub_utf8_to_utf16 (grub_uint16_t *dest, grub_size_t destsize,
                    const grub_uint8_t *src, grub_size_t srcsize,