From eced21209cdad6cf4ff64c6008b71b45a226d905 Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 6 Aug 2001 22:01:31 +0000 Subject: o Correctly define rcsid. o Add consts where appropriate. o Rename some variables that were shadowing global declarations. o Remove register storage-classes. o Make errmsg a const, so we can just set error messages instead of using sprintf/strcpy. o Set WARNS=2 Reviewed by: bde, des --- bin/ed/undo.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'bin/ed/undo.c') diff --git a/bin/ed/undo.c b/bin/ed/undo.c index b2063c7..8feb381 100644 --- a/bin/ed/undo.c +++ b/bin/ed/undo.c @@ -26,12 +26,8 @@ */ #ifndef lint -#if 0 -static char * const rcsid = "@(#)undo.c,v 1.1 1994/02/01 00:34:44 alm Exp"; -#else -static char * const rcsid = +static const char rcsid[] = "$FreeBSD$"; -#endif #endif /* not lint */ #include "ed.h" @@ -55,7 +51,7 @@ push_undo_stack(type, from, to) if (ustack == NULL && (ustack = (undo_t *) malloc((usize = USIZE) * sizeof(undo_t))) == NULL) { fprintf(stderr, "%s\n", strerror(errno)); - sprintf(errmsg, "out of memory"); + errmsg = "out of memory"; return NULL; } #endif @@ -70,7 +66,7 @@ push_undo_stack(type, from, to) } /* out of memory - release undo stack */ fprintf(stderr, "%s\n", strerror(errno)); - sprintf(errmsg, "out of memory"); + errmsg = "out of memory"; clear_undo_stack(); free(ustack); ustack = NULL; @@ -98,7 +94,7 @@ pop_undo_stack() long o_addr_last = addr_last; if (u_current_addr == -1 || u_addr_last == -1) { - sprintf(errmsg, "nothing to undo"); + errmsg = "nothing to undo"; return ERR; } else if (u_p) modified = 1; -- cgit v1.1