The ugliest code snippet I could find today is the code required to initialize a MySQL database:
MYSQL *mysql = malloc(sizeof(MYSQL));
/* Note: we omit the NULL pointer check here because MySQL does it too. */
if((mysql=mysql_init(mysql))==NULL)
{
(error handling)
}