|
|
Message-ID: <op.w0fxr9s7bp85gn@cctorw7d10.capitalc.internal>
Date: Thu, 18 Jul 2013 19:20:23 -0400
From: "Kirill Ternosvky" <kternovsky@...dex.ru>
To: musl@...ts.openwall.com
Subject: musl regression tests
/* FILE: scanf-nullbyte-char.c
/*
Commit: ef5507867b59d19f21437970e87b5d0415c07b2e
scanf should not append null byte after scanning %c
*/
#include <stdio.h>
#include "test.h"
int main(void)
{
char target_buffer[2] = { 'a', 'a' };
char source_buffer = 'b';
sscanf(&source_buffer, "%c", &target_buffer);
if(target_buffer[1] != 'a' && !target_buffer[1])
{
t_error("scanf stored null byte for %%c conversion\n");
}
return 0;
}
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.