summaryrefslogtreecommitdiff
path: root/usr.bin/locate
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-11-16 00:04:54 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-11-16 00:04:54 +0000
commit0dc9b4623e64324a3a03461973271e48965aa220 (patch)
treef8297b6c54fef7fe654b25ffd0936bb805e8d69a /usr.bin/locate
parent60502a8eea486c599be4428718de3a8370b9f0b5 (diff)
correct type in sizeof by switching to sizeof(*ptr). (harmless)
from Nicolas Bedos
Diffstat (limited to 'usr.bin/locate')
-rw-r--r--usr.bin/locate/locate/util.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/locate/locate/util.c b/usr.bin/locate/locate/util.c
index 2643ed10c32..b10b7ff24f1 100644
--- a/usr.bin/locate/locate/util.c
+++ b/usr.bin/locate/locate/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.11 2014/10/08 04:04:37 doug Exp $
+/* $OpenBSD: util.c,v 1.12 2014/11/16 00:04:53 tedu Exp $
*
* Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
* Copyright (c) 1989, 1993
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: util.c,v 1.11 2014/10/08 04:04:37 doug Exp $
+ * $Id: util.c,v 1.12 2014/11/16 00:04:53 tedu Exp $
*/
@@ -72,8 +72,8 @@ check_bigram_char(ch)
/* split a colon separated string into a char vector
*
- * "bla:foo" -> {"foo", "bla"}
- * "bla:" -> {"foo", dot}
+ * "bla:foo" -> {"bla", "foo"}
+ * "bla:" -> {"bla", dot}
* "bla" -> {"bla"}
* "" -> do nothing
*
@@ -89,7 +89,7 @@ colon(dbv, path, dot)
char **pv;
if (dbv == NULL) {
- if ((dbv = malloc(sizeof(char **))) == NULL)
+ if ((dbv = malloc(sizeof(*dbv))) == NULL)
err(1, "malloc");
*dbv = NULL;
}
@@ -123,7 +123,7 @@ colon(dbv, path, dot)
}
/* increase dbv with element p */
if ((newdbv = reallocarray(dbv, vlen + 2,
- sizeof(char **))) == NULL)
+ sizeof(*newdbv))) == NULL)
err(1, "realloc");
dbv = newdbv;
*(dbv + vlen) = p;