Hya,
calloc already sets memory to 0 and i think that if we already have
a function to verify if a given char is an space, we should use it.
ok? comments?
-rm
===================================================================
--- lib/pqueue.c (revision 2482)
+++ lib/pqueue.c (working copy)
@@ -47,7 +47,6 @@
free(q);
return NULL;
}
- memset(q->d, 0, (n + 1) * sizeof(void *));
q->size = 1;
q->avail = q->step = (n + 1); /* see comment above about n+1 */
Index: base/nagiostats.c
===================================================================
--- base/nagiostats.c (revision 2482)
+++ base/nagiostats.c (working copy)
@@ -1349,7 +1349,7 @@
/* strip end of string */
y = (int)strlen(buffer);
for(x = y - 1; x >= 0; x--) {
- if(buffer[x] == ' ' || buffer[x] == '\n' || buffer[x] == '\r' || buffer[x] == '\t' || buffer[x] == 13)
+ if(isspace(buffer[x]))
buffer[x] = '\x0';
else
break;
@@ -1358,7 +1358,7 @@
/* strip beginning of string (by shifting) */
y = (int)strlen(buffer);
for(x = 0; x < y; x++) {
- if(buffer[x] == ' ' || buffer[x] == '\n' || buffer[x] == '\r' || buffer[x] == '\t' || buffer[x] == 13)
+ if(isspace(buffer[x]))
continue;
else
break;
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]