Skip to content

Commit 489063d

Browse files
committed
fix conversion problem from char to unsigned char
1 parent b031e11 commit 489063d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ bool dirExists(const char* path)
221221
//bool unpackFile(const char *srcName, const char *destPath)
222222
bool unpackFile(spiffs_dirent *spiffsFile, const char *destPath)
223223
{
224-
char buffer[spiffsFile->size];
224+
u8_t buffer[spiffsFile->size];
225225
std::string filename = (const char*)(spiffsFile->name);
226226

227227
// Open file from spiffs file system.
@@ -237,7 +237,8 @@ bool unpackFile(spiffs_dirent *spiffsFile, const char *destPath)
237237
FILE* dst = fopen(destPath, "wb");
238238

239239
// Write content into file.
240-
fputs(buffer, dst);
240+
//fputs(buffer, dst);
241+
fwrite(buffer, sizeof(u8_t), sizeof(buffer), dst);
241242

242243
// Close file.
243244
fclose(dst);

0 commit comments

Comments
 (0)