summaryrefslogtreecommitdiff
path: root/src/skaembutils/s6-grep.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-01-07 21:43:42 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-01-07 21:43:42 +0000
commit1ddf95240c77ae0786dd29e14acdf3549be9094c (patch)
treeebff87b299cb9fec7a841c03ac13e54a9f165952 /src/skaembutils/s6-grep.c
parent1a5f11e0cf9e5287a50f032838e787c38003a1a4 (diff)
downloads6-portable-utils-1ddf95240c77ae0786dd29e14acdf3549be9094c.tar.xz
Types fix: first pass
Preparation for the skalibs size_t API change.
Diffstat (limited to 'src/skaembutils/s6-grep.c')
-rw-r--r--src/skaembutils/s6-grep.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/skaembutils/s6-grep.c b/src/skaembutils/s6-grep.c
index b42e807..0af770c 100644
--- a/src/skaembutils/s6-grep.c
+++ b/src/skaembutils/s6-grep.c
@@ -1,5 +1,6 @@
/* ISC license. */
+#include <sys/types.h>
#include <errno.h>
#include <regex.h>
#include <string.h>
@@ -56,7 +57,7 @@ int main (int argc, char const *const *argv)
stralloc line = STRALLOC_ZERO ;
regex_t re ;
unsigned int num = 0 ;
- unsigned int arglen = str_len(argv[0]) ;
+ size_t arglen = str_len(argv[0]) ;
if (!flags.fixed)
{
register int e = regcomp(&re, argv[0], REG_NOSUB | (flags.extended ? REG_EXTENDED : 0) | (flags.ignorecase ? REG_ICASE : 0)) ;
@@ -106,7 +107,7 @@ int main (int argc, char const *const *argv)
if (flags.num)
{
char fmt[UINT_FMT] ;
- register unsigned int n = uint_fmt(fmt, num) ;
+ register size_t n = uint_fmt(fmt, num) ;
fmt[n++] = ':' ;
if (buffer_put(buffer_1, fmt, n) < (int)n)
strerr_diefu1sys(111, "write to stdout") ;
@@ -123,9 +124,9 @@ int main (int argc, char const *const *argv)
if (flags.count)
{
char fmt[UINT_FMT] ;
- register unsigned int n = uint_fmt(fmt, count) ;
+ register size_t n = uint_fmt(fmt, count) ;
fmt[n++] = '\n' ;
- if (buffer_put(buffer_1, fmt, n) < (int)n)
+ if (buffer_put(buffer_1, fmt, n) < (ssize_t)n)
strerr_diefu1sys(111, "write to stdout") ;
}
return !count ;