X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/b271b4c2bb0bafebace4e86180adb68d66730fad..42db3a2c36e26e0106b1e480407e32d3c8c09bef:/sbr/snprintb.c diff --git a/sbr/snprintb.c b/sbr/snprintb.c index 629da4b7..e221b4e5 100644 --- a/sbr/snprintb.c +++ b/sbr/snprintb.c @@ -1,24 +1,25 @@ - -/* - * snprintb.c -- snprintf a %b string +/* snprintb.c -- snprintf a %b string * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ -#include +#include "h/mh.h" +#include "snprintb.h" char * snprintb (char *buffer, size_t n, unsigned v, char *bits) { - register int i, j; - register char c, *bp; + size_t len; + int i, j; + char c, *bp; snprintf (buffer, n, bits && *bits == 010 ? "0%o" : "0x%x", v); - bp = buffer + strlen(buffer); - n -= strlen(buffer); + len = strlen(buffer); + bp = buffer + len; + n -= len; if (bits && *++bits) { j = 0;