| 116 | } |
| 117 | |
| 118 | static int32_t GetBaseInt(HConfigFile config, const char* key, int32_t default_value) |
| 119 | { |
| 120 | const char* tmp = GetBaseString(config, key, 0); |
| 121 | if (tmp == 0) |
| 122 | return default_value; |
| 123 | int l = strlen(tmp); |
| 124 | char* end = 0; |
| 125 | int32_t ret = strtol(tmp, &end, 10); |
| 126 | if (end != (tmp + l) || end == tmp) |
| 127 | { |
| 128 | dmLogWarning("Unable to convert '%s' to int", tmp); |
| 129 | return default_value; |
| 130 | } |
| 131 | return ret; |
| 132 | } |
| 133 | |
| 134 | static bool GetIntOverride(HConfigFile config, const char* key, int32_t default_value, int32_t* out_value) |
| 135 | { |
no test coverage detected