ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Inifile_Reader.c
(Generate patch)

Comparing Daodan/src/inifile_reader.c (file contents):
Revision 451 by rossy, Sun Jul 26 12:04:44 2009 UTC vs.
Revision 692 by alloc, Thu Mar 7 17:26:13 2013 UTC

# Line 1 | Line 1
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++;
# Line 113 | Line 112 | bool inifile_read(const char* filename,
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.

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)