Apply a couple of patches from calim of nouveau.

One's an actual bug, the other a bit of error checking (not sure how
necessary it is, but it's in code that we don't /want/ to run, so it can't
hurt :)
This commit is contained in:
Bill Currie 2012-04-25 08:48:46 +09:00
parent e167300a84
commit a7870a98a1
2 changed files with 5 additions and 2 deletions

View file

@ -432,8 +432,11 @@ Sys_Error (const char *error, ...)
static int in_sys_error = 0;
if (in_sys_error) {
size_t cnt;
const char *msg = "\nSys_Error: recursive error condition\n";
write (2, msg, strlen (msg));
cnt = write (2, msg, strlen (msg));
if (cnt < 0)
perror ("write failed");
abort ();
}
in_sys_error = 1;

View file

@ -256,7 +256,7 @@ PF_newstr (progs_t *pr)
int s = dstr->size;
dstr->size = P_FLOAT (pr, 1) + 1;
dstring_adjust (dstr);
memset (dstr->str + s, dstr->size - s, 0);
memset (dstr->str + s, 0, dstr->size - s);
}
R_STRING (pr) = i;