if (mpz_out_str(stdout, 10, counter) == 0) {
mpz_clear(counter);
// FUCKING FPRINT
if (fprintf(stderr, "something failed\n") < 0) {
if (fprintf(stderr, "something failed\n") < 0) {
if (fprintf(stderr, "something failed\n") < 0) {
if (fprintf(stderr, "something failed\n") < 0) {
if (fprintf(stderr, "something failed\n") < 0) {
if (fprintf(stderr, "something failed\n") < 0) {
if (fprintf(stderr, "something failed\n") < 0) {
if (fprintf(stderr, "something failed\n") < 0) {
// WHAT THE FUCK?!
}
}
}
}
}
}
}
}
return EXIT_FAILURE;
}
fix:
/* stuff happens here too */
Name:
Anonymous2010-08-25 18:51
I call this the "if it fails, then I as a programmer fucked up and there's no point in attempting to recover with exception clauses or complex error handling logic because something is seriously fucked until I fix it" method.
You're welcome.
#include <assert.h>
/* stuff happens here */
int success = mpz_out_str(stdout, 10, counter);
assert(success != 0);
>>14
Because the abort call causes the program to return a non-zero value (typically EXIT_FAILURE), so when the !fork() expression is evaluated, it is false and the for loop never makes it through a single iteration. Only two forks of the program are spawned.
>>14
It looks ok to me... fork() returns a PID, and the loop will only exit for the one case where PID = 0, which is probably reserved on just about every OS. So it just infinitely spawns processes that infinitely spawn processes...
>>14
when !fork() is evaluated, the parent process exits the loop and the child continues. each child process forks several times before exiting the loop. since there are more processes being spawned than exiting, the total number of processes will grow, but at a much slower rate than a traditional forkbomb. since the original process exits the loop fairly early, it might seem at first like nothing is wrong. it's not really a dud, but it's not really a bomb either.
Name:
Anonymous2013-08-31 6:59
No shit? Where did this come from? Story development doesn't mean it has to be mystery.
Name:
Anonymous2013-08-31 7:44
Pure muscle memory for me. Some of the harder songs I might fail a bunch, but I catch on if I keep it up.
Rin-chan Now! is a good example of a song that I got stuck on for a long time before I was able to do it.
Name:
Anonymous2013-08-31 8:30
Like the Coffee Alice from Anko 722? Indeed she was perfect.