summaryrefslogtreecommitdiff
path: root/src/libstddjb/sareadlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/sareadlink.c')
-rw-r--r--src/libstddjb/sareadlink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstddjb/sareadlink.c b/src/libstddjb/sareadlink.c
index d6c2a4e..90810e9 100644
--- a/src/libstddjb/sareadlink.c
+++ b/src/libstddjb/sareadlink.c
@@ -6,16 +6,16 @@
int sareadlink (stralloc *sa, char const *path)
{
- unsigned int n = 128 ;
+ size_t n = 128 ;
int wasnull = !sa->s ;
- register int r ;
+ ssize_t r ;
for (;;)
{
if (!stralloc_readyplus(sa, n)) goto err ;
r = readlink(path, sa->s + sa->len, n) ;
if (r < 0) goto err ;
- if ((unsigned int)r < n) break ;
+ if ((size_t)r < n) break ;
n += 128 ;
}
sa->len += r ;