Always evaluate BT_ASSERT(); add BT_ASSERT_DBG() for debug mode only
[babeltrace.git] / src / compat / stdio.h
index 906e695dfd9227a438195fec0ab8c293a4033a22..12a7ba65e8845f0fc8593d2d9fbdf7d4d7f7dca5 100644 (file)
@@ -37,10 +37,10 @@ char * _bt_getline_bufalloc(char **lineptr, size_t *n, size_t linelen)
        size_t buflen = *n;
        char *buf = *lineptr;
 
-       if (buflen >= linelen && buf != NULL) {
+       if (buflen >= linelen && buf) {
                return buf;
        }
-       if (buf == NULL) {
+       if (!buf) {
                buflen = BT_GETLINE_MINBUFLEN;
        } else {
                buflen = buflen << 1;
@@ -80,7 +80,7 @@ ssize_t bt_getline(char **lineptr, size_t *n, FILE *stream)
        char *buf;
        int found_eof = 0;
 
-       if (lineptr == NULL || n == NULL) {
+       if (!lineptr || !n) {
                errno = EINVAL;
                return -1;
        }
@@ -94,7 +94,7 @@ ssize_t bt_getline(char **lineptr, size_t *n, FILE *stream)
                                /* ferror() is set, errno set by fgetc(). */
                                return -1;
                        }
-                       BT_ASSERT(feof(stream));
+                       BT_ASSERT_DBG(feof(stream));
                        found_eof = 1;
                        break;
                }
This page took 0.025621 seconds and 4 git commands to generate.