Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/udf/udf_osta.c

    rb2906c0 r5c702a8  
    5151#include "udf_osta.h"
    5252#include "udf_cksum.h"
     53
     54/** Calculate length of UTF-16 string
     55 *
     56 * FIXME: This is wrong! UTF-16 is not a fixed-width encoding,
     57 *        it is a variable-width encoding (mind the surrogate
     58 *        pairs).
     59 *
     60 */
     61static size_t utf16_length(uint16_t *string) {
     62        size_t len = 0;
     63       
     64        while (*string++ != 0)
     65                len++;
     66       
     67        return len;
     68}
    5369
    5470/** Illegal UNIX characters are NULL and slash.
     
    280296                ucode_chars =
    281297                    udf_uncompress_unicode(len, (uint8_t *) id, raw_name, MAX_BUF);
    282                 ucode_chars = min(ucode_chars, utf16_wsize(raw_name));
     298                ucode_chars = min(ucode_chars, utf16_length(raw_name));
    283299                nice_uchars =
    284300                    udf_translate_name(unix_name, raw_name, ucode_chars);
Note: See TracChangeset for help on using the changeset viewer.