_user_debug_output(): Fix for long strings
The wrong length was passed to debug_puts().
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user