| 135 | } |
| 136 | |
| 137 | const char *iniSectionsValue(const char *section, int section_num, const char *variable) |
| 138 | { |
| 139 | iniline_t *ptr = ini; |
| 140 | int n = 0; |
| 141 | |
| 142 | while(ptr != NULL) |
| 143 | { |
| 144 | if(strcmp(section, ptr->data) == 0 && ptr->issection) |
| 145 | { |
| 146 | if(n == section_num) |
| 147 | { |
| 148 | break; |
| 149 | } |
| 150 | else |
| 151 | { |
| 152 | n++; |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | ptr = ptr->next; |
| 157 | } |
| 158 | |
| 159 | size_t varlen = strlen(variable); |
| 160 | |
| 161 | if(ptr) |
| 162 | { |
| 163 | ptr = ptr->next; |
| 164 | |
| 165 | while(ptr != NULL) |
| 166 | { |
| 167 | if(ptr->issection) |
| 168 | { |
| 169 | break; |
| 170 | } |
| 171 | |
| 172 | if(strncmp(ptr->data, variable, varlen) == 0) |
| 173 | { |
| 174 | char *sptr = ptr->data + varlen; |
| 175 | while(*sptr != '\0') |
| 176 | { |
| 177 | switch(*sptr) |
| 178 | { |
| 179 | case ' ': |
| 180 | case '\t': |
| 181 | case '=': |
| 182 | break; |
| 183 | default: |
| 184 | return sptr; |
| 185 | } |
| 186 | sptr++; |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | ptr = ptr->next; |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | return NULL; |
no outgoing calls
no test coverage detected