From 73e836b1cee1e8a1b97374251737dcae652568a5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 30 Sep 2017 07:53:01 +0200 Subject: [PATCH] Updates --- streams/file_stream.c | 2 +- string/stdstring.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/streams/file_stream.c b/streams/file_stream.c index d022c04..c2ba594 100644 --- a/streams/file_stream.c +++ b/streams/file_stream.c @@ -568,7 +568,7 @@ int filestream_close(RFILE *stream) if (!stream) goto error; - if (stream->ext && !string_is_empty(stream->ext)) + if (!string_is_empty(stream->ext)) free(stream->ext); #if defined(PSP) diff --git a/string/stdstring.c b/string/stdstring.c index 88a436f..78113ea 100644 --- a/string/stdstring.c +++ b/string/stdstring.c @@ -161,9 +161,6 @@ char *word_wrap(char* buffer, const char *string, int line_width, bool unicode) unsigned char_len; unsigned j = i; - character = utf8skip(&string[i], 1); - char_len = character - &string[i]; - /* check if end of string reached */ if (i == len) { @@ -171,6 +168,9 @@ char *word_wrap(char* buffer, const char *string, int line_width, bool unicode) return buffer; } + character = utf8skip(&string[i], 1); + char_len = character - &string[i]; + if (!unicode) counter += char_len - 1;