summaryrefslogtreecommitdiffstats
path: root/source/a/sysklogd/sysklogd-1.4.1-owl-syslogd-crunch_list.diff
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2011-04-25 13:37:00 +0000
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:45:18 +0200
commit75a4a592e5ccda30715f93563d741b83e0dcf39e (patch)
tree502f745607e77a2c4386ad38d818ddcafe81489c /source/a/sysklogd/sysklogd-1.4.1-owl-syslogd-crunch_list.diff
parentb76270bf9e6dd375e495fec92140a79a79415d27 (diff)
downloadcurrent-75a4a592e5ccda30715f93563d741b83e0dcf39e.tar.gz
current-75a4a592e5ccda30715f93563d741b83e0dcf39e.tar.xz
Slackware 13.37slackware-13.37
Mon Apr 25 13:37:00 UTC 2011 Slackware 13.37 x86_64 stable is released! Thanks to everyone who pitched in on this release: the Slackware team, the folks producing upstream code, and linuxquestions.org for providing a great forum for collaboration and testing. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. As always, thanks to the Slackware community for testing, suggestions, and feedback. :-) Have fun!
Diffstat (limited to 'source/a/sysklogd/sysklogd-1.4.1-owl-syslogd-crunch_list.diff')
-rw-r--r--source/a/sysklogd/sysklogd-1.4.1-owl-syslogd-crunch_list.diff90
1 files changed, 0 insertions, 90 deletions
diff --git a/source/a/sysklogd/sysklogd-1.4.1-owl-syslogd-crunch_list.diff b/source/a/sysklogd/sysklogd-1.4.1-owl-syslogd-crunch_list.diff
deleted file mode 100644
index 268309297..000000000
--- a/source/a/sysklogd/sysklogd-1.4.1-owl-syslogd-crunch_list.diff
+++ /dev/null
@@ -1,90 +0,0 @@
---- ./syslogd.c.orig 2007-04-09 18:17:05.000000000 -0500
-+++ ./syslogd.c 2007-04-09 18:25:22.000000000 -0500
-@@ -1273,61 +1273,55 @@
- crunch_list(list)
- char *list;
- {
-- int count, i;
-+ int i, m, n;
- char *p, *q;
- char **result = NULL;
-
- p = list;
-
- /* strip off trailing delimiters */
-- while (p[strlen(p)-1] == LIST_DELIMITER) {
-- count--;
-+ while (*p && p[strlen(p)-1] == LIST_DELIMITER)
- p[strlen(p)-1] = '\0';
-- }
- /* cut off leading delimiters */
-- while (p[0] == LIST_DELIMITER) {
-- count--;
-- p++;
-- }
--
-- /* count delimiters to calculate elements */
-- for (count=i=0; p[i]; i++)
-- if (p[i] == LIST_DELIMITER) count++;
--
-- if ((result = (char **)malloc(sizeof(char *) * (count+2))) == NULL) {
-+ while (p[0] == LIST_DELIMITER)
-+ p++;
-+
-+ /* count delimiters to calculate the number of elements */
-+ for (n = i = 0; p[i]; i++)
-+ if (p[i] == LIST_DELIMITER) n++;
-+
-+ if ((result = (char **)malloc(sizeof(char *) * (n + 2))) == NULL) {
- printf ("Sorry, can't get enough memory, exiting.\n");
-- exit(0);
-+ exit(1);
- }
--
-+
- /*
- * We now can assume that the first and last
- * characters are different from any delimiters,
- * so we don't have to care about this.
- */
-- count = 0;
-- while ((q=strchr(p, LIST_DELIMITER))) {
-- result[count] = (char *) malloc((q - p + 1) * sizeof(char));
-- if (result[count] == NULL) {
-+ m = 0;
-+ while ((q = strchr(p, LIST_DELIMITER)) && m < n) {
-+ result[m] = (char *) malloc((q - p + 1) * sizeof(char));
-+ if (result[m] == NULL) {
- printf ("Sorry, can't get enough memory, exiting.\n");
-- exit(0);
-+ exit(1);
- }
-- strncpy(result[count], p, q - p);
-- result[count][q - p] = '\0';
-+ memcpy(result[m], p, q - p);
-+ result[m][q - p] = '\0';
- p = q; p++;
-- count++;
-+ m++;
- }
-- if ((result[count] = \
-- (char *)malloc(sizeof(char) * strlen(p) + 1)) == NULL) {
-+ if ((result[m] = strdup(p)) == NULL) {
- printf ("Sorry, can't get enough memory, exiting.\n");
-- exit(0);
-+ exit(1);
- }
-- strcpy(result[count],p);
-- result[++count] = NULL;
-+ result[++m] = NULL;
-
- #if 0
-- count=0;
-- while (result[count])
-- dprintf ("#%d: %s\n", count, StripDomains[count++]);
-+ m = 0;
-+ while (result[m])
-+ dprintf ("#%d: %s\n", m, result[m++]);
- #endif
- return result;
- }