Opened 4 years ago

Closed 4 years ago

#112 closed defect (fixed)

libc: perror behaves incorrectly when its input is an empty string

Reported by: Lukáš Zaoral Owned by:
Priority: minor Milestone: 4.4
Component: DiOS Keywords:
Cc: kdudka@…, lzaoral@…

Description

Hi,
perror should print only the error message, when its input is an empty string. See https://pubs.opengroup.org/onlinepubs/9699919799/functions/perror.html.

Code:

#include <errno.h>
#include <stdio.h>

int main(void)
{
    errno = 0;
    perror("");
}

Issue:

$ divine exec perror.c
compiling perror.c
loading bitcode … DiOS … LART … RR … constants … done
booting … done
: Success
a report was written to p.report

The ": " part should not be there and the enclosed patch fixes it.

Attachments (1)

perror.patch (387 bytes) - added by Lukáš Zaoral 4 years ago.

Download all attachments as: .zip

Change History (2)

Changed 4 years ago by Lukáš Zaoral

Attachment: perror.patch added

comment:1 Changed 4 years ago by Henrich Lauko

Resolution: fixed
Status: newclosed

Patch accepted.

Note: See TracTickets for help on using tickets.