1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-24 09:57:09 +00:00

extract function getenvint to common.c

This commit is contained in:
Helmut Grohne 2013-01-28 16:35:25 +01:00
parent 50b2baaf69
commit c01ddbb0c0
3 changed files with 13 additions and 13 deletions

View file

@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
int writeyes(void) {
puts("yes");
@ -12,3 +13,11 @@ int writeno(const char *s) {
puts("no");
return 1;
}
int getenvint(const char *name, int defvalue) {
const char *value;
value = getenv(name);
if(value == NULL)
return defvalue;
return atoi(value);
}