* editcmd.c (sprintf_p): Don't cast (char *) to (unsigned long).

This commit is contained in:
Andrew V. Samoilov 2001-12-22 17:34:51 +00:00
parent c69a25c5eb
commit 3f55f6bf2f
2 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,8 @@
Undefine "close" before closing file created by mc_mkstemps.
Define close to mc_close after it - temporary fix.
(sprintf_p): Don't cast (char *) to (unsigned long).
* syntax.c (read_one_line): Undo last patch - errno is a
function on some systems. Check ferror() status before
everithing else if fgetc returns EOF.

View File

@ -1491,7 +1491,7 @@ static int sprintf_p (char *str, const char *fmt,...)
p = q = (char *) fmt;
while ((p = strchr (p, '%'))) {
n = (int) ((unsigned long) p - (unsigned long) q);
n = p - q;
strncpy (s, q, n); /* copy stuff between format specifiers */
s += n;
*s = 0;
@ -1563,7 +1563,7 @@ static int sprintf_p (char *str, const char *fmt,...)
}
va_end (ap);
sprintf (s, q); /* print trailing leftover */
return (unsigned long) s - (unsigned long) str + strlen (s);
return s - str + strlen (s);
}
static void regexp_error (WEdit *edit)