mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-02 04:46:46 -05:00
Ignores spaces at the end of the line in the configuration file.
This commit is contained in:
parent
1876e2be50
commit
c69590ffbe
3 changed files with 56 additions and 34 deletions
21
util.c
21
util.c
|
|
@ -166,7 +166,7 @@ int sgettok(STREAM* f, char* str, int size)
|
|||
|
||||
*i = 0;
|
||||
|
||||
return 0;
|
||||
return i - str;
|
||||
}
|
||||
|
||||
int sgetline(STREAM* f, char* str, int size)
|
||||
|
|
@ -219,7 +219,24 @@ int sgetline(STREAM* f, char* str, int size)
|
|||
|
||||
*i = 0;
|
||||
|
||||
return 0;
|
||||
return i - str;
|
||||
}
|
||||
|
||||
int sgetlasttok(STREAM* f, char* str, int size)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = sgetline(f, str, size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
while (ret > 0 && (str[ret-1] == ' ' || str[ret-1] == '\t')) {
|
||||
--ret;
|
||||
}
|
||||
|
||||
str[ret] = 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int sgetu32(STREAM* f, uint32_t* value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue