_user_debug_output(): Fix for long strings

The wrong length was passed to debug_puts().
This commit is contained in:
Ingo Weinhold
2013-09-11 04:43:47 +02:00
parent 406ad5bece
commit b1c3379c7e
+5 -3
View File
@@ -2268,13 +2268,15 @@ _user_debug_output(const char* userString)
char string[512];
int32 length;
int32 toWrite;
do {
length = user_strlcpy(string, userString, sizeof(string));
if (length <= 0)
break;
debug_puts(string, length);
userString += sizeof(string) - 1;
} while (length >= (ssize_t)sizeof(string));
toWrite = std::min(length, (int32)sizeof(string) - 1);
debug_puts(string, toWrite);
userString += toWrite;
} while (length > toWrite);
}