Module Name:    src
Committed By:   christos
Date:           Tue Oct 13 12:11:20 UTC 2009

Modified Files:
        src/usr.sbin/sup/source: expand.c

Log Message:
- use const where appropriate
- don't cast return value from malloc


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/sup/source/expand.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sup/source/expand.c
diff -u src/usr.sbin/sup/source/expand.c:1.16 src/usr.sbin/sup/source/expand.c:1.17
--- src/usr.sbin/sup/source/expand.c:1.16	Fri Jul 20 12:39:05 2007
+++ src/usr.sbin/sup/source/expand.c	Tue Oct 13 08:11:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: expand.c,v 1.16 2007/07/20 16:39:05 christos Exp $	*/
+/*	$NetBSD: expand.c,v 1.17 2009/10/13 12:11:19 christos Exp $	*/
 
 /*
  * Copyright (c) 1991 Carnegie Mellon University
@@ -80,7 +80,7 @@
 static char pathbuf[MAXPATHLEN];
 static char *path, *pathp, *lastpathp;
 
-static char *globchars = "{[*?";/* meta characters */
+static const char globchars[] = "{[*?";/* meta characters */
 static char *entp;		/* current dir entry pointer */
 
 static char **BUFFER;		/* pointer to the buffer */
@@ -95,7 +95,7 @@
 static int execbrc(char *, char *);
 static int match(char *, char *);
 static int amatch(char *, char *);
-static void addone(char *, char *);
+static void addone(char *, const char *);
 static int addpath(char);
 static int gethdir(char *, int);
 
@@ -361,7 +361,7 @@
 }
 
 static void 
-addone(char *s1, char *s2)
+addone(char *s1, const char *s2)
 {
 	char *ep;
 
@@ -369,7 +369,7 @@
 		bufcnt = BUFSIZE + 1;
 		longjmp(sjbuf, 1);
 	}
-	ep = (char *) malloc(strlen(s1) + strlen(s2) + 1);
+	ep = malloc(strlen(s1) + strlen(s2) + 1);
 	if (ep == 0) {
 		bufcnt = -1;
 		longjmp(sjbuf, 1);

Reply via email to