diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-09-26 01:52:50 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:39:33 +0200 |
commit | 527179c68597b907dbd6bdc6489181306e9e19ec (patch) | |
tree | 7b90b284b1927edc22b080da7ffe7e5b3620b466 /src | |
parent | 2bbcfbf4014d332121c65d7480a42556f02d00bc (diff) |
Fix build for linux
Diffstat (limited to 'src')
-rw-r--r-- | src/Exec.cpp | 4 | ||||
-rw-r--r-- | src/FileUtil.cpp | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/Exec.cpp b/src/Exec.cpp index 659d812..a183ed2 100644 --- a/src/Exec.cpp +++ b/src/Exec.cpp @@ -19,9 +19,9 @@ namespace sibs while(!feof(pipe)) { - int bytesRead = fgets(buffer, BUFSIZE, pipe); - if(bytesRead > 0) + if(fgets(buffer, BUFSIZE, pipe)) { + int bytesRead = strlen(buffer); execStdout.append(buffer, bytesRead); if(print) printf("%.*s", bytesRead, buffer); diff --git a/src/FileUtil.cpp b/src/FileUtil.cpp index e29ed36..222edbb 100644 --- a/src/FileUtil.cpp +++ b/src/FileUtil.cpp @@ -32,7 +32,16 @@ static int makedir(const _tinydir_char_t *dir) namespace sibs { #if OS_FAMILY == OS_FAMILY_POSIX -#define toUtf8(input) input + std::string toUtf8(const std::string &input) + { + return input; + } + + std::string toUtf8(const char *input) + { + return input; + } + FileString toFileString(const std::string &utf8Str) { return utf8Str; |