Skip to content

Commit

Permalink
Changed the usage of sizeof({type}) to sizeof({variable}) to avoid pr…
Browse files Browse the repository at this point in the history
…oblems in the future when changing variable types
  • Loading branch information
JustAn0therDev committed Mar 12, 2023
1 parent 53f371f commit 3b25732
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Findin C/Main.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ size_t FindIn(char* search, char* filePath, char* subDirectoryToShow) {
lineSize++;

if (line == 0) {
line = malloc(sizeof(char) + 1);
line = malloc(sizeof(c) + 1);

if (line == 0) {
exit(1);
Expand All @@ -171,7 +171,7 @@ size_t FindIn(char* search, char* filePath, char* subDirectoryToShow) {
}
else {
char* oldLineBuffer = line;
line = realloc(line, sizeof(char) * (lineSize + 1));
line = realloc(line, sizeof(c) * (lineSize + 1));

if (line == 0) {
free(oldLineBuffer);
Expand Down

0 comments on commit 3b25732

Please sign in to comment.