fix prev commit: correctly check on left side too

This commit is contained in:
marschap
2006-04-07 16:40:13 +00:00
parent 0ff8c4e032
commit 7c0590b37b
2 changed files with 10 additions and 11 deletions
+4 -5
View File
@@ -145,13 +145,12 @@ debug_string (Driver *drvthis, int x, int y, char string[])
y --; x --; // Convert 1-based coords to 0-based...
if ((x < 0) || (y < 0) || (x >= width) || (y >= height))
if ((y < 0) || (y >= height))
return;
for (i = 0; string[i] != '\0'; i++) {
if (x + i >= width)
break;
framebuf[(y * width) + x + i] = string[i];
for (i = 0; (string[i] != '\0') && (x < width); i++, x++) {
if (x >= 0) // no write left of left border
framebuf[(y * width) + x] = string[i];
}
}