2008-10-10 14:56:32

Ugliest code snippet of the day: MySQL initialization

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) }


Posted by Tonnerre Lombard | Permanent link | File under: broken, programming