source: zzuf/trunk/test/bug-div0.c @ 4253

Last change on this file since 4253 was 4253, checked in by sam, 5 years ago

Fix copyright information and remove Id tag everywhere.

File size: 771 bytes
Line 
1/*
2 *  bug-div0 - program dividing by zero when fuzzed
3 *  Copyright (c) 2008 Sam Hocevar <sam@hocevar.net>
4 *                All Rights Reserved
5 *
6 *  This program is free software. It comes without any warranty, to
7 *  the extent permitted by applicable law. You can redistribute it
8 *  and/or modify it under the terms of the Do What The Fuck You Want
9 *  To Public License, Version 2, as published by Sam Hocevar. See
10 *  http://sam.zoy.org/wtfpl/COPYING for more details.
11 */
12
13#include "config.h"
14
15#include <stdio.h>
16#include <stdlib.h>
17#include <signal.h>
18
19int buf[1];
20
21int main(void)
22{
23    int ch;
24
25    while((ch = getc(stdin)) != EOF)
26    {
27        buf[0] = 1 / !ch;
28        if(ch) raise(SIGFPE); /* Needed on OS X... sigh. */
29    }
30
31    return EXIT_SUCCESS;
32}
33
Note: See TracBrowser for help on using the repository browser.