Fixed whitespace
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c
index 695fccb..1f5a120 100644
--- a/src/stdlib/SDL_string.c
+++ b/src/stdlib/SDL_string.c
@@ -641,19 +641,16 @@ SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_
size_t bytes = SDL_min(src_bytes, dst_bytes - 1);
size_t i = 0;
unsigned char trailing_bytes = 0;
- if (bytes)
- {
+
+ if (bytes) {
unsigned char c = (unsigned char)src[bytes - 1];
- if (UTF8_IsLeadByte(c))
+ if (UTF8_IsLeadByte(c)) {
--bytes;
- else if (UTF8_IsTrailingByte(c))
- {
- for (i = bytes - 1; i != 0; --i)
- {
+ } else if (UTF8_IsTrailingByte(c)) {
+ for (i = bytes - 1; i != 0; --i) {
c = (unsigned char)src[i];
trailing_bytes = UTF8_TrailingBytes(c);
- if (trailing_bytes)
- {
+ if (trailing_bytes) {
if (bytes - i != trailing_bytes + 1)
bytes = i;
@@ -664,6 +661,7 @@ SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_
SDL_memcpy(dst, src, bytes);
}
dst[bytes] = '\0';
+
return bytes;
}