diff options
author | claudio <claudio@openbsd.org> | 2021-03-22 11:25:29 +0000 |
---|---|---|
committer | claudio <claudio@openbsd.org> | 2021-03-22 11:25:29 +0000 |
commit | ae581bab6024559846e5aca8389e8ae39ea2dff8 (patch) | |
tree | 2a55f091541d8c54d611de8272ec6fa7af678b6a /usr.bin | |
parent | Put comment where it belongs also remove an assert() that checks for an (diff) | |
download | wireguard-openbsd-ae581bab6024559846e5aca8389e8ae39ea2dff8.tar.xz wireguard-openbsd-ae581bab6024559846e5aca8389e8ae39ea2dff8.zip |
Adjust a type to unsigned since the io function works on unsigned ints.
Also the id is a strictly positve integer so this make sense.
Cleanup comments and a spacing while there.
From kristaps@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rsync/ids.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/rsync/ids.c b/usr.bin/rsync/ids.c index a4b7480044c..721c455474e 100644 --- a/usr.bin/rsync/ids.c +++ b/usr.bin/rsync/ids.c @@ -1,4 +1,4 @@ -/* $Id: ids.c,v 1.13 2019/05/08 21:30:11 benno Exp $ */ +/* $Id: ids.c,v 1.14 2021/03/22 11:25:29 claudio Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -26,7 +26,7 @@ #include "extern.h" /* - * Free a list of struct ident previously allocated with idents_gid_add(). + * Free a list of struct ident previously allocated with idents_add(). * Does nothing if the pointer is NULL. */ void @@ -104,7 +104,7 @@ idents_remap(struct sess *sess, int isgid, struct ident *ids, size_t idsz) struct group *grp; struct passwd *usr; uint32_t id; - int valid; + int valid; assert(!sess->opts->numeric_ids); @@ -267,7 +267,7 @@ int idents_recv(struct sess *sess, int fd, struct ident **ids, size_t *idsz) { - int32_t id; + uint32_t id; uint8_t sz; void *pp; @@ -299,6 +299,7 @@ idents_recv(struct sess *sess, } else if (sz == 0) WARNX("zero-length name in identifier list"); + assert(id < INT32_MAX); (*ids)[*idsz].id = id; (*ids)[*idsz].name = calloc(sz + 1, 1); if ((*ids)[*idsz].name == NULL) { |