_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];
|
char string[512];
|
||||||
int32 length;
|
int32 length;
|
||||||
|
int32 toWrite;
|
||||||
do {
|
do {
|
||||||
length = user_strlcpy(string, userString, sizeof(string));
|
length = user_strlcpy(string, userString, sizeof(string));
|
||||||
if (length <= 0)
|
if (length <= 0)
|
||||||
break;
|
break;
|
||||||
debug_puts(string, length);
|
toWrite = std::min(length, (int32)sizeof(string) - 1);
|
||||||
userString += sizeof(string) - 1;
|
debug_puts(string, toWrite);
|
||||||
} while (length >= (ssize_t)sizeof(string));
|
userString += toWrite;
|
||||||
|
} while (length > toWrite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user