Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <op.w0g95e0zbp85gn@cctorw7d10.capitalc.internal>
Date: Fri, 19 Jul 2013 12:45:04 -0400
From: "Kirill Ternosvky" <kternovsky@...dex.ru>
To: musl@...ts.openwall.com
Subject: Re: musl regression tests

/* FILE: scanf-bytes-consumed.c */
/*
  * Commit: 5efc6af4ebb9d50eb978d0338835544fdfea0396
  * scanf misreports bytes consumed when EOF is hit (or null for sscanf)
  */

#include <stdio.h>
#include "test.h"

int main(void)
{
	char buf[] = { 'a', 'a', 0 };
	char dest[3];
	int read_count;

	sscanf(buf, "%s%n", dest, &read_count);

	if(read_count != 2)
	{
		t_error("sscanf consumed 2 bytes but reported %d\n", read_count);
	}
}

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.