Category Archives: Uncategorized

FriendFeed was acquired by Facebook?!

According to Slashdot, that’s what happened. I don’t really find much use for FriendFeed (I’d have an information overload, if everyone I knew used it). But I have handed them over a list of services I used, and they happily fed off the data I provided about my use habits.

And I was ok with that.
But Facebook is kind-of … not very widely known for its care about users’ privacy, is it? So the only thing I left active on my FriendFeed account is a link to this blog. I may close the account completely, if there’s a link, because I find it enough to have a single Facebook account, thankyouverymuch.
That reminds me, I should clean up the Facebook account of the more private data, too.

Iron Roses released!


Iron Roses, the adventure game by Cateia Games that marked the last few months of my work-life, has went through the QA, and was released by Sandlot Games today! Yip-yip hurray!

Iron Roses, aside from great work by our own musicians, includes nice tunes from Megasapien.
Check out the game, and go buy it! 🙂

Fixing "warning: missing sentinel in function call"

I got it for the folowing line:

execl("/bin/sh", "sh", "-c", sessioncommand.c_str(), 0);

Quite easy to fix:

execl("/bin/sh", "sh", "-c", sessioncommand.c_str(), (char*)0);

—————————————–

Alright. Since I’m getting “lots” of hits on this, let’s see if we can improve this post. (June 28th 2010, more examples added July 22nd 2010, style but not content updated April 19 2014)

Generally, you’re missing a sentinel if you don’t add a “NULL” in C/C++, or a “nil” in Objective-C. In above example in C, I presume the compiler did not notice the zero (a valid sentinel) and threw a warning. That’s what this post was mostly about.

However, it could also happen if you really did forget to add the sentinel. What is the purpose of this “sentinel”? When iterating through a varlist**, the function needs to know where to stop. In printf() and scanf(), the format string specifies this number of arguments. Functions could also accept the number of arguments as one of the arguments. Third option is this — specifying a sentinel, such as NULL or nil, as something that will stop further iteration.

Examples of sentinels in C:

execl("/bin/sh", "sh", "-c", sessioncommand.c_str(), NULL);

and in Objective-C:

NSArray *names = [NSArray arrayWithObjects: @"Ivan", @"Ana", @"Marko", @"Petar", nil];

** Iterating through a varlist – which is how you iterate through arguments in variadic functions, those with variable number of arguments

close() of listening socket from another thread

Just a warning.

Calling close() on listening socket in another thread will NOT prevent another connection from being made. Instead, you must call shutdown(). This should abort existing select() calls (probably accept() too, but I didn’t try).

Guess how I found out 🙂