Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lemonorangeapple committed Jan 22, 2024
1 parent 03da6ae commit 27fb734
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/update.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ string execute(const char *command) {
char result[2048] = {0};
FILE *ptr;
strcpy(result, command);
if((ptr = popen(result, "r"))) {
if ((ptr = popen(result, "r"))) {
while (fgets(buffer, 2048, ptr)) {
strcat(result, buffer);
if (strlen(result) > 2048) {
break;
if (strlen(result) + strlen(buffer) <= 2048) {
strcat(result, buffer);
}
}
pclose(ptr);
Expand Down

0 comments on commit 27fb734

Please sign in to comment.