diff --git a/c-programming/io/freadln.c b/c-programming/io/freadln.c index b9a6d5f..56b7579 100644 --- a/c-programming/io/freadln.c +++ b/c-programming/io/freadln.c @@ -16,7 +16,7 @@ #include "freadln.h" -ssize_t freadln(char** output, size_t* length_out) { +int freadln(char** output, size_t* length_out) { /* * The length of STDIN line is counted without any terminating characters. * diff --git a/c-programming/io/freadln.h b/c-programming/io/freadln.h index 8680dc2..0026352 100644 --- a/c-programming/io/freadln.h +++ b/c-programming/io/freadln.h @@ -21,14 +21,11 @@ enum freadln_status { #define freadln_success_epilogue do { \ (*output)[length] = '\0'; \ - if (length_out == NULL) \ - return length; \ - else { \ + if (length_out != NULL) \ *length_out = length; \ - return freadln_OK; \ - } \ + return freadln_OK; \ } while (0) -ssize_t freadln(char** output, size_t* length_out); +int freadln(char** output, size_t* length_out); #endif /* _FREADLN_H */