kind of fixed 'ignoring return value' problem
saying I bypassed compiler would sound weird, so yeah... 🤠
This commit is contained in:
parent
fd6aa19eba
commit
215121f209
@ -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
|
||||
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user