Skip to content

Instantly share code, notes, and snippets.

@sgielen
Created May 12, 2013 00:12
Show Gist options
  • Save sgielen/5561885 to your computer and use it in GitHub Desktop.
Save sgielen/5561885 to your computer and use it in GitHub Desktop.
sjors@foo:/tmp$ cat main.c
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
long bar = strtol(argv[1], NULL, 10);
printf("bar = %ld\n", bar);
int foo = 5 / bar;
printf("I'm still here\n");
return 0;
}
sjors@foo:/tmp$ ./main 0
bar = 0
Drijvendekomma-berekeningsfout
sjors@foo:/tmp$ export LANG=C
sjors@foo:/tmp$ ./main 0
bar = 0
Floating point exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment