Age | Commit message (Collapse) | Author |
|
The line-by-line reading function in the io library was specifically
added for this kind of use case, so we don't have to handle trimming
of lines, don't have to touch getline() and it's convoluted error
handling (return value -1 could mean either EOF or error).
The code that searches for '\n' and replaces it with '\0' can be
removed as well and a memory leak involving "line" is removed along
the way.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
- Some of the error/cleanup paths are merged.
- Struct fields don't have to be set to NULL if the entire struct is
free'd immediately after.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Similar to the hex blob decoder, we need this once for tar and
once for the filemap xattr parser.
Simply add a single, central implementation to libutil, with a
simple unit test, and then use it in both libtar and gensquashfs.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Since we need it twice (once for tar, once for the filemap xattr
parser), add a single, central implementation to libutil, add a
unit test for that implementation and then use it in both libtar
and gensquashfs.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
|