kind of fixed 'ignoring return value' problem

saying I bypassed compiler would sound weird, so yeah... 🤠
This commit is contained in:
Václav Šmejkal 2022-12-09 14:09:15 +01:00
parent fd6aa19eba
commit 215121f209
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19
4 changed files with 4 additions and 5 deletions

View File

@ -58,7 +58,7 @@ outputFlags encryptText(char *text, char *keyNew)
//TRY TO MAKE RANDOM GENERATION REALLY "RANDOM"
fileBuffer = fopen("/dev/urandom", "r");
if (fread(&numberBuffer, sizeof(numberBuffer), 1, fileBuffer) != 1) abort(); //TODO: Make it safe
(void) (fread(&numberBuffer, sizeof(numberBuffer), 1, fileBuffer) + 1); //TODO: Try to create some function for processing exit value
srand(numberBuffer);
numberBuffer = abs(numberBuffer); //MAKE numberBuffer POSITIVE

View File

@ -141,7 +141,7 @@ boolean checkVersion()
strcpy(buffer, "");
//LOAD jsonFile
if (fread(buffer, bufferSize, 1, fileBuffer) != 1) abort(); //TODO: Make it safe
(void) (fread(buffer, bufferSize, 1, fileBuffer) + 1); //TODO: Try to create some function for processing exit value
buffer[bufferSize] = '\0';

View File

@ -99,8 +99,7 @@ void writeLog(int loggerFile, char *logMessage)
sprintf(buffer, WRITE_FORMATTING, tm.tm_hour, tm.tm_min, tm.tm_sec, logMessage); //LOAD MESSAGE
if (write(loggerFile, buffer, strlen(buffer)) != (ssize_t) strlen(buffer)) abort(); //WRITE (YAY) //TODO: Find why the fuck you can't use version line bellow
//(void) write(loggerFile, buffer, strlen(buffer));
(void) (write(loggerFile, buffer, strlen(buffer)) + 1); //TODO: Try to create some function for processing exit value
//DEALLOCATION
free(buffer);

View File

@ -40,7 +40,7 @@ int main(void)
buffer = malloc(bufferSize + 1);
//LOAD jsonFile
if (fread(buffer, bufferSize, 1, fileBuffer) != 1) abort(); //TODO: Make it safe
(void) (fread(buffer, bufferSize, 1, fileBuffer) + 1); //TODO: Try to create some function for processing exit value
printf("%s\n", buffer);