+1998-10-16 Nathan Bryant <bryant@cs.usm.maine.edu>
+ * sysdep.c (cprintf): generate a newline on truncated buffer
+
Thu Oct 15 19:27:32 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* msgbase.c: reimplemented cmd_move()
room_ops.c: wrote AddMessageToRoom() which is used for both entering
void cprintf(const char *format, ...) {
va_list arg_ptr;
char buf[256];
- int rc;
va_start(arg_ptr, format);
- rc = vsnprintf(buf, sizeof buf, format, arg_ptr);
- va_end(arg_ptr);
-
+ if (vsnprintf(buf, sizeof buf, format, arg_ptr) == -1)
+ buf[sizeof buf - 2] = '\n';
client_write(buf, strlen(buf));
+ va_end(arg_ptr);
}