Skip to content

Commit

Permalink
fix: fopen for fwrite use binary mode
Browse files Browse the repository at this point in the history
this avoids adding a carriage return on windows
  • Loading branch information
jaromil committed Dec 15, 2024
1 parent fcad0d7 commit 8ff6779
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/muntar.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ int untar_to_path(const char *path, const uint8_t *buf,
const size_t namelen = strlen(header->name);
if(p-tpath+namelen>1023) return(MTAR_EOPENFAIL);
strcpy(p,header->name);

Check warning on line 221 in src/muntar.c

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] src/muntar.c#L221

Almost always, snprintf is better than strcpy [runtime/printf] [4]
Raw output
src/muntar.c:221:  Almost always, snprintf is better than strcpy  [runtime/printf] [4]
FILE *fp = fopen(tpath,"w");
FILE *fp = fopen(tpath,"wb");
if(!fp) {
fprintf(stderr,
"Error open file for write: %s\n",
Expand Down

0 comments on commit 8ff6779

Please sign in to comment.