aboutsummaryrefslogtreecommitdiff
path: root/src/rc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-11 23:17:53 +0000
committerRoy Marples <roy@marples.name>2007-10-11 23:17:53 +0000
commite3bc6666d6d5bd8922ca10652a2d04577357fa71 (patch)
treef88c80fc6ce912790a347bbcd53a8df80e15c152 /src/rc.c
parent14287ddd80b3c2d7eb44b3bee77caab4c4d6eca2 (diff)
malloc data size, not pointer size
Diffstat (limited to 'src/rc.c')
-rw-r--r--src/rc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rc.c b/src/rc.c
index c236bd50..0f21fe86 100644
--- a/src/rc.c
+++ b/src/rc.c
@@ -1105,7 +1105,7 @@ int main (int argc, char **argv)
if ((dp = opendir ("/dev/net"))) {
while ((d = readdir (dp))) {
i = (strlen ("net.") + strlen (d->d_name) + 1);
- tmp = xmalloc (sizeof (char *) * i);
+ tmp = xmalloc (sizeof (char) * i);
snprintf (tmp, i, "net.%s", d->d_name);
if (rc_service_exists (tmp) &&
rc_service_plugable (tmp))
@@ -1126,7 +1126,7 @@ int main (int argc, char **argv)
char *p = d->d_name + 3;
if (p && isdigit (*p)) {
i = (strlen ("moused.") + strlen (d->d_name) + 1);
- tmp = xmalloc (sizeof (char *) * i);
+ tmp = xmalloc (sizeof (char) * i);
snprintf (tmp, i, "moused.%s", d->d_name);
if (rc_service_exists (tmp) && rc_service_plugable (tmp))
rc_service_mark (tmp, RC_SERVICE_COLDPLUGGED);
@@ -1246,7 +1246,7 @@ int main (int argc, char **argv)
continue;
len = strlen (service) + strlen (runlevel) + 2;
- tmp = xmalloc (sizeof (char *) * len);
+ tmp = xmalloc (sizeof (char) * len);
snprintf (tmp, len, "%s.%s", service, runlevel);
conf = rc_strcatpaths (RC_CONFDIR, tmp, (char *) NULL);
found = exists (conf);
@@ -1254,7 +1254,7 @@ int main (int argc, char **argv)
CHAR_FREE (tmp);
if (! found) {
len = strlen (service) + strlen (newlevel) + 2;
- tmp = xmalloc (sizeof (char *) * len);
+ tmp = xmalloc (sizeof (char) * len);
snprintf (tmp, len, "%s.%s", service, newlevel);
conf = rc_strcatpaths (RC_CONFDIR, tmp, (char *) NULL);
found = exists (conf);