diff options
author | Mike Barcroft <mike@FreeBSD.org> | 2001-08-06 22:01:31 +0000 |
---|---|---|
committer | Mike Barcroft <mike@FreeBSD.org> | 2001-08-06 22:01:31 +0000 |
commit | a4616748ab35cbec2b9601dec15cab58a809e7d5 (patch) | |
tree | 0469fc49295a48c1140722bbff569214e2135f58 /bin/ed/undo.c | |
parent | 1e1bbe0f97e5529441c15ba7ed4c4e66b18a363e (diff) | |
download | src-a4616748ab35cbec2b9601dec15cab58a809e7d5.tar.gz src-a4616748ab35cbec2b9601dec15cab58a809e7d5.zip |
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
Notes
Notes:
svn path=/head/; revision=81220
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 b2063c7c2791..8feb38187e0f 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; |