]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: (sample) check scols_line_refer_data() return code [coverity scan]
authorKarel Zak <kzak@redhat.com>
Tue, 14 Jul 2020 10:18:01 +0000 (12:18 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 14 Jul 2020 10:18:01 +0000 (12:18 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/samples/continuous.c

index dfe54b604a3dc231fd1246bcd57f19e28ede53df..fe3a8752cbed0f8f59874f2738c097c16e7fb86a 100644 (file)
@@ -91,7 +91,8 @@ int main(int argc, char *argv[])
                /* Make a reference from cell data to the buffer, then we can
                 * update cell data without any interaction with libsmartcols
                 */
-               scols_line_refer_data(line, COL_TIME, timecell);
+               if (scols_line_refer_data(line, COL_TIME, timecell) != 0)
+                       err(EXIT_FAILURE, "failed to add data to table");
 
                do {
                        double diff;