| 1 |
|
#include <stdio.h> |
| 2 |
|
#include <stdlib.h> |
| 3 |
< |
#include <stdbool.h> |
| 3 |
> |
#include "stdint.h" |
| 4 |
|
#include <string.h> |
| 5 |
|
#include <ctype.h> |
| 6 |
|
|
| 7 |
< |
#include "inifile.h" |
| 7 |
> |
#include "Inifile_Reader.h" |
| 8 |
|
|
| 9 |
|
char* inifile_cleanstr(char* str) |
| 10 |
|
{ |
| 11 |
|
int i; |
| 12 |
|
for (i = strlen(str) - 1; i >= 0; i --) |
| 13 |
< |
if (!isspace(str[i])) |
| 14 |
< |
{ |
| 15 |
< |
str[i + 1] = '\0'; |
| 13 |
> |
if (isspace(str[i])) |
| 14 |
> |
str[i] = '\0'; |
| 15 |
> |
else |
| 16 |
|
break; |
| 17 |
– |
} |
| 17 |
|
|
| 18 |
|
while (isspace(*str)) |
| 19 |
|
str++; |
| 112 |
|
|
| 113 |
|
if (inisection[0]) |
| 114 |
|
free(inisection); |
| 115 |
< |
inisection = strdup(readptr + 1); // Skip the first [ |
| 115 |
> |
inisection = _strdup(readptr + 1); // Skip the first [ |
| 116 |
|
newsection = true; |
| 117 |
|
} |
| 118 |
|
else // It's a value. |