mirror of https://github.com/MidnightCommander/mc
* editcmd.c (sprintf_p): Don't cast (char *) to (unsigned long).
This commit is contained in:
parent
c69a25c5eb
commit
3f55f6bf2f
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue