~roger-booth/mysql-proxy/laminator

« back to all changes in this revision

Viewing changes to src/network-mysqld-proto.c

  • Committer: jan at mysql
  • Date: 2009-11-11 11:42:45 UTC
  • Revision ID: jan@mysql.com-20091111114245-ml6dgbjjkrkmcmpj
replaced assert() on missing trailing space by a "return -1"

Show diffs side-by-side

added added

removed removed

Lines of Context:
567
567
        guint64 len;
568
568
        int err = 0;
569
569
 
570
 
        for (len = 0; packet->offset + len < packet->data->len && *(packet->data->str + packet->offset + len); len++);
 
570
        for (len = 0; packet->offset + len < packet->data->len && *(packet->data->str + packet->offset + len) != '\0'; len++);
571
571
 
572
 
        g_assert(*(packet->data->str + packet->offset + len) == '\0'); /* this has to be a \0 */
 
572
        if (packet->offset + len == packet->data->len) { /* havn't found a trailing \0 */
 
573
                return -1;
 
574
        }
573
575
 
574
576
        if (len > 0) {
575
577
                g_assert(packet->offset < packet->data->len);