aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/hexdump
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-04-28 07:50:45 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-04-28 07:50:45 +0000
commit3b8f08459569bf0faa21473e5cec2491e95c9349 (patch)
tree80f45dd81ca716bcd7ca9674581e1fc40b93cd34 /usr.bin/hexdump
parent9d2ab4a62d6733c45958627ac113bdbd818d1e2a (diff)
parentb2ba55951383498f252746f618d513139da06e8e (diff)
downloadsrc-3b8f08459569bf0faa21473e5cec2491e95c9349.tar.gz
src-3b8f08459569bf0faa21473e5cec2491e95c9349.zip
Merge head
Notes
Notes: svn path=/projects/bmake/; revision=265044
Diffstat (limited to 'usr.bin/hexdump')
-rw-r--r--usr.bin/hexdump/hexdump.h6
-rw-r--r--usr.bin/hexdump/parse.c13
2 files changed, 8 insertions, 11 deletions
diff --git a/usr.bin/hexdump/hexdump.h b/usr.bin/hexdump/hexdump.h
index be85bd9ca4c3..e34d3a011300 100644
--- a/usr.bin/hexdump/hexdump.h
+++ b/usr.bin/hexdump/hexdump.h
@@ -82,9 +82,9 @@ enum _vflag { ALL, DUP, FIRST, WAIT }; /* -v values */
extern enum _vflag vflag;
void add(const char *);
-void addfile(char *);
-void badcnt(char *);
-void badconv(char *);
+void addfile(const char *);
+void badcnt(const char *);
+void badconv(const char *);
void badfmt(const char *);
void badsfmt(void);
void bpad(PR *);
diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c
index b10ce01948ba..1e0612028f86 100644
--- a/usr.bin/hexdump/parse.c
+++ b/usr.bin/hexdump/parse.c
@@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
FU *endfu; /* format at end-of-data */
void
-addfile(char *name)
+addfile(const char *name)
{
unsigned char *p;
FILE *fp;
@@ -210,7 +210,6 @@ rewrite(FS *fs)
int nconv, prec;
size_t len;
- nextpr = NULL;
prec = 0;
for (fu = fs->nextfu; fu; fu = fu->nextfu) {
@@ -218,13 +217,11 @@ rewrite(FS *fs)
* Break each format unit into print units; each conversion
* character gets its own.
*/
+ nextpr = &fu->nextpr;
for (nconv = 0, fmtp = fu->fmt; *fmtp; nextpr = &pr->nextpr) {
if ((pr = calloc(1, sizeof(PR))) == NULL)
err(1, NULL);
- if (!fu->nextpr)
- fu->nextpr = pr;
- else
- *nextpr = pr;
+ *nextpr = pr;
/* Skip preceding text and up to the next % sign. */
for (p1 = fmtp; *p1 && *p1 != '%'; ++p1);
@@ -494,7 +491,7 @@ escape(char *p1)
}
void
-badcnt(char *s)
+badcnt(const char *s)
{
errx(1, "%s: bad byte count", s);
}
@@ -512,7 +509,7 @@ badfmt(const char *fmt)
}
void
-badconv(char *ch)
+badconv(const char *ch)
{
errx(1, "%%%s: bad conversion character", ch);
}