/[baselayout]/trunk/src/rc.c
Gentoo

Diff of /trunk/src/rc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2549 Revision 2550
1011 } 1011 }
1012 1012
1013 /* Unless we would use a different config file */ 1013 /* Unless we would use a different config file */
1014 if (found) 1014 if (found)
1015 { 1015 {
1016 int len;
1016 if (! newlevel) 1017 if (! newlevel)
1017 continue; 1018 continue;
1018 1019
1019 tmp = rc_xmalloc (strlen (service) + strlen (runlevel) + 2); 1020 len = strlen (service) + strlen (runlevel) + 2;
1021 tmp = rc_xmalloc (sizeof (char *) * len);
1020 sprintf (tmp, "%s.%s", service, runlevel); 1022 snprintf (tmp, len, "%s.%s", service, runlevel);
1021 conf = rc_strcatpaths (RC_CONFDIR, tmp, (char *) NULL); 1023 conf = rc_strcatpaths (RC_CONFDIR, tmp, (char *) NULL);
1022 found = rc_exists (conf); 1024 found = rc_exists (conf);
1023 CHAR_FREE (conf); 1025 CHAR_FREE (conf);
1024 CHAR_FREE (tmp); 1026 CHAR_FREE (tmp);
1025 if (! found) 1027 if (! found)
1026 { 1028 {
1027 tmp = rc_xmalloc (strlen (service) + strlen (newlevel) + 2); 1029 len = strlen (service) + strlen (newlevel) + 2;
1030 tmp = rc_xmalloc (sizeof (char *) * len);
1028 sprintf (tmp, "%s.%s", service, newlevel); 1031 snprintf (tmp, len, "%s.%s", service, newlevel);
1029 conf = rc_strcatpaths (RC_CONFDIR, tmp, (char *) NULL); 1032 conf = rc_strcatpaths (RC_CONFDIR, tmp, (char *) NULL);
1030 found = rc_exists (conf); 1033 found = rc_exists (conf);
1031 CHAR_FREE (conf); 1034 CHAR_FREE (conf);
1032 CHAR_FREE (tmp); 1035 CHAR_FREE (tmp);
1033 if (!found) 1036 if (!found)

Legend:
Removed from v.2549  
changed lines
  Added in v.2550

  ViewVC Help
Powered by ViewVC 1.1.20