Details

[Home]

Issue of the Standard # S0524

Brief

The scanw() functions do not return OK upon successful completion

Detailed Description

LSB refers to SUSv2 (The Single UNIX Specification, Version 2) for the description of the libncurses functions. According to this standard, upon successful completion scanw() family of functions shall return OK. But in man pages it is written that "scanw returns ERR on failure and an integer equal to the number of fields scanned on success". In reality the functions behave according to man pages but not to the LSB in the case of success.

The following code illustrates the problem.

#include 
#include 
	
int main( int argc, char ** argv ) 
{
	int res;
	int var;
	initscr();

	ungetch('\n');
	ungetch('0');
	ungetch('1');
	ungetch(' ');
	res = mvscanw(5, 5, " %i", &var);
	endwin();
	
	printf("Result of mvscanw():%d!=OK(%d), var=%d\n", res, OK, var);
	
	return 0;
}

Problem location(s) in the standard

Linux Standard Base Core Specification 3.1, Chapter 14. Utility Libraries, 14.5. Interfaces for libncurses.

Accepted

LSB Bugzilla, 2350

Status

Fixed in LSB 4.0

[Home]