diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-03-30 20:56:55 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-03-30 20:56:55 +0000 |
commit | a1aec9c4b02c06fc344177e3bf5cad1c6a02bb7c (patch) | |
tree | 1a045e4feead8586ec79ebc920857bfe6a674db1 /lib/libutil | |
parent | 931c529317ec18320d529461e71be9a09cdd5d5e (diff) |
casts that cannot cause breakage in the future
Diffstat (limited to 'lib/libutil')
-rw-r--r-- | lib/libutil/uucplock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libutil/uucplock.c b/lib/libutil/uucplock.c index 8f3f3e8858e..23a71a47c81 100644 --- a/lib/libutil/uucplock.c +++ b/lib/libutil/uucplock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uucplock.c,v 1.14 2005/11/28 21:54:06 deraadt Exp $ */ +/* $OpenBSD: uucplock.c,v 1.15 2006/03/30 20:56:54 deraadt Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -201,7 +201,7 @@ put_pid(int fd, pid_t pid) len = snprintf(buf, sizeof buf, "%10ld\n", (long)pid); - if (len < sizeof buf && len != -1 && write (fd, buf, len) == len) { + if (len < sizeof buf && len != -1 && write(fd, buf, (size_t)len) == len) { /* We don't mind too much if ftruncate() fails - see get_pid */ ftruncate(fd, (off_t)len); return 1; @@ -212,14 +212,14 @@ put_pid(int fd, pid_t pid) static pid_t get_pid(int fd, int *err) { - int bytes_read; + ssize_t bytes_read; char buf[32]; pid_t pid; bytes_read = read(fd, buf, sizeof (buf) - 1); if (bytes_read > 0) { buf[bytes_read] = '\0'; - pid = strtoul(buf, (char **) NULL, 10); + pid = (pid_t)strtoul(buf, (char **) NULL, 10); } else { pid = -1; *err = bytes_read ? errno : EINVAL; |