From 80f0debf2032e16629cb13682b8fb9ceccde423c Mon Sep 17 00:00:00 2001 From: Eduardo Casino Date: Tue, 24 May 2022 07:58:48 +0200 Subject: Add support for hash-generated short file names --- unicode.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'unicode.h') diff --git a/unicode.h b/unicode.h index 81d187a..730d549 100644 --- a/unicode.h +++ b/unicode.h @@ -40,9 +40,9 @@ static inline uint8_t lookup_codepage( TSRDATAPTR data, uint16_t cp ) } // dst and src CAN'T BE THE SAME !!!! -// Returns resulting length or -1 if buffer overflow +// Returns resulting length or 0 if buffer overflow // -static uint16_t local_to_utf8_n( TSRDATAPTR data, uint8_t *dst, const char far *src, uint16_t buflen, uint16_t count ) +static uint16_t local_to_utf8_n( TSRDATAPTR data, uint8_t *dst, char far *src, uint16_t buflen, uint16_t count ) { uint16_t len = 0; // Resulting length uint16_t cp; // Unicode Code Point @@ -63,7 +63,7 @@ static uint16_t local_to_utf8_n( TSRDATAPTR data, uint8_t *dst, const char far * } else { - return -1; + return 0; } } @@ -83,7 +83,7 @@ static uint16_t local_to_utf8_n( TSRDATAPTR data, uint8_t *dst, const char far * } else { - return -1; + return 0; } } @@ -102,7 +102,7 @@ static uint16_t local_to_utf8_n( TSRDATAPTR data, uint8_t *dst, const char far * } else { - return -1; + return 0; } } cont: @@ -117,7 +117,7 @@ cont: } -static inline uint16_t local_to_utf8( TSRDATAPTR data, uint8_t *dst, const char far *src, uint16_t buflen ) +static inline uint16_t local_to_utf8( TSRDATAPTR data, uint8_t *dst, char far *src, uint16_t buflen ) { return local_to_utf8_n( data, dst, src, buflen, buflen ); } -- cgit v1.2.3