diff options
author | mike <mike@FreeBSD.org> | 2001-08-06 22:01:31 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2001-08-06 22:01:31 +0000 |
commit | eced21209cdad6cf4ff64c6008b71b45a226d905 (patch) | |
tree | 0469fc49295a48c1140722bbff569214e2135f58 /bin/ed/undo.c | |
parent | e7f429490d285f94132046b59db80b6d1fe253c4 (diff) | |
download | FreeBSD-src-eced21209cdad6cf4ff64c6008b71b45a226d905.zip FreeBSD-src-eced21209cdad6cf4ff64c6008b71b45a226d905.tar.gz |
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
Diffstat (limited to 'bin/ed/undo.c')
-rw-r--r-- | bin/ed/undo.c | 12 |
1 files changed, 4 insertions, 8 deletions
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; |