Skip to content

Commit

Permalink
consistency
Browse files Browse the repository at this point in the history
~ reworded memory allocation errors to be more consistent with other
  error messages
+ added usage guide if wrong usage is used
  • Loading branch information
karshPrime committed Aug 4, 2024
1 parent 96070f2 commit e445016
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datastream.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ char* piped_data() {
bufferSize += 256;
char *newBuffer = realloc(inputBuffer, bufferSize);
if (!newBuffer) {
fprintf(stderr, "Memory allocation error\n");
fprintf(stderr, "Error: Memory allocation\n");
free(inputBuffer);
exit(1);
}
Expand All @@ -37,7 +37,7 @@ char* piped_data() {
bufferSize += 1;
char *newBuffer = realloc(inputBuffer, bufferSize);
if (!newBuffer) {
fprintf(stderr, "Memory allocation error\n");
fprintf(stderr, "Error: Memory allocation\n");
free(inputBuffer);
exit(1);
}
Expand Down
1 change: 1 addition & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ int main(int argc, char** argv) {
// invalid command was used
if (lActionIndex == ActionsCount) {
fprintf(stderr, "Error: Invalid Argument: %s\n", cmd);
print_usage();
return 1;
}

Expand Down

0 comments on commit e445016

Please sign in to comment.