* dcrt0.cc (__api_fatal): Drop spare argument to __small_sprintf.

* smallprint.c (__small_vsprintf): Preserve GetLastError value.
	* winsup.h (api_fatal): Simplify.  Drop duplicate filename arg.
This commit is contained in:
Corinna Vinschen
2006-10-27 10:41:51 +00:00
parent 6aea277648
commit 17f3068d4e
4 changed files with 12 additions and 3 deletions

View File

@ -71,6 +71,8 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
char *orig = dst;
const char *s;
DWORD err = GetLastError ();
while (*fmt)
{
int i, n = 0x7fff;
@ -125,7 +127,7 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
break;
case 'E':
strcpy (dst, "Win32 error ");
dst = __rn (dst + sizeof ("Win32 error"), 10, 0, GetLastError (), len, pad, LMASK);
dst = __rn (dst + sizeof ("Win32 error"), 10, 0, err, len, pad, LMASK);
break;
case 'd':
dst = rnarg (dst, 10, addsign, len, pad);
@ -180,6 +182,7 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
}
}
*dst = 0;
SetLastError (err);
return dst - orig;
}