~ubuntu-branches/ubuntu/oneiric/collectd/oneiric

« back to all changes in this revision

Viewing changes to src/common.c

  • Committer: Bazaar Package Importer
  • Author(s): Morten Kjeldgaard
  • Date: 2008-11-18 15:54:20 UTC
  • mfrom: (1.1.5 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20081118155420-sc2mxv2pebafkmon
Tags: 4.4.2-2ubuntu1
* Merge from Debian unstable (LP: #298828). Remaining Ubuntu changes:
* Add ubuntu_in6-glibc28.dpatch patch, fix FTBFS.
* Add ubuntu_hardening.dpatch patch, fix FTBFS.
* Add ubuntu_perl.c.dpatch, fix FTBFS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
        if((r = strdup (s)) == NULL)
72
72
        {
73
 
                DEBUG ("Not enough memory.");
74
 
                exit(3);
 
73
                ERROR ("Not enough memory.");
 
74
                exit (3);
75
75
        }
76
76
 
77
77
        return (r);
78
 
}
 
78
} /* char *sstrdup */
79
79
 
80
80
/* Even though Posix requires "strerror_r" to return an "int",
81
81
 * some systems (e.g. the GNU libc) return a "char *" _and_
131
131
 
132
132
        if ((r = malloc (size)) == NULL)
133
133
        {
134
 
                DEBUG("Not enough memory.");
135
 
                exit(3);
 
134
                ERROR ("Not enough memory.");
 
135
                exit (3);
136
136
        }
137
137
 
138
 
        return r;
139
 
}
 
138
        return (r);
 
139
} /* void *smalloc */
140
140
 
141
141
#if 0
142
142
void sfree (void **ptr)
224
224
        i = 0;
225
225
        ptr = string;
226
226
        saveptr = NULL;
227
 
        while ((fields[i] = strtok_r (ptr, " \t", &saveptr)) != NULL)
 
227
        while ((fields[i] = strtok_r (ptr, " \t\r\n", &saveptr)) != NULL)
228
228
        {
229
229
                ptr = NULL;
230
230
                i++;