unicode.c
changeset 63 5a82f89d607e
parent 62 b7061c0e239f
child 77 49e0babccb23
equal deleted inserted replaced
62:b7061c0e239f 63:5a82f89d607e
     9 #include <locale.h>
     9 #include <locale.h>
    10 #include <string.h>
    10 #include <string.h>
    11 
    11 
    12 #define FACTOR 1.42
    12 #define FACTOR 1.42
    13 
    13 
    14 wchar_t *substr (const wchar_t * s, int start, int end)
    14 wchar_t *substr (const wchar_t * s, size_t start, size_t end)
    15 {
    15 {
    16     wchar_t *str;
    16     wchar_t *str;
    17 
    17 
    18     int len = end - start;
    18     size_t len = end - start;
    19 
    19 
    20     if (len < 1)
    20     if (len < 1)
    21         return NULL;
    21         return NULL;
    22 
    22 
    23     if ((str = malloc (sizeof (wchar_t) * (len + 1))) == NULL)
    23     if ((str = malloc (sizeof (wchar_t) * (len + 1))) == NULL)