=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/file/Attic/funcs.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/file/Attic/funcs.c 2004/05/19 02:36:26 1.2 --- src/usr.bin/file/Attic/funcs.c 2005/04/11 16:31:35 1.3 *************** *** 1,4 **** ! /* $OpenBSD: funcs.c,v 1.2 2004/05/19 02:36:26 tedu Exp $ */ /* * Copyright (c) Christos Zoulas 2003. * All Rights Reserved. --- 1,4 ---- ! /* $OpenBSD: funcs.c,v 1.3 2005/04/11 16:31:35 deraadt Exp $ */ /* * Copyright (c) Christos Zoulas 2003. * All Rights Reserved. *************** *** 35,41 **** #include #ifndef lint ! FILE_RCSID("@(#)$Id: funcs.c,v 1.2 2004/05/19 02:36:26 tedu Exp $") #endif /* lint */ /* * Like printf, only we print to a buffer and advance it. --- 35,41 ---- #include #ifndef lint ! FILE_RCSID("@(#)$Id: funcs.c,v 1.3 2005/04/11 16:31:35 deraadt Exp $") #endif /* lint */ /* * Like printf, only we print to a buffer and advance it. *************** *** 49,55 **** va_start(ap, fmt); ! if ((len = vsnprintf(ms->o.ptr, ms->o.len, fmt, ap)) >= ms->o.len) { va_end(ap); if ((buf = realloc(ms->o.buf, len + 1024)) == NULL) { file_oomem(ms); --- 49,56 ---- va_start(ap, fmt); ! len = vsnprintf(ms->o.ptr, ms->o.len, fmt, ap); ! if (len == -1 || len >= ms->o.len) { va_end(ap); if ((buf = realloc(ms->o.buf, len + 1024)) == NULL) { file_oomem(ms);