Mercurial > dovecot > core-2.2
diff src/lib-sql/sql-api.c @ 11086:260e190306b0 HEAD
Started using str_to_*() functions instead of libc's ones.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 07 Apr 2010 01:49:00 +0300 |
parents | 615eef3139c2 |
children | 1c8cc349ef55 |
line wrap: on
line diff
--- a/src/lib-sql/sql-api.c Wed Apr 07 01:48:03 2010 +0300 +++ b/src/lib-sql/sql-api.c Wed Apr 07 01:49:00 2010 +0300 @@ -195,17 +195,15 @@ break; } case SQL_TYPE_UINT: { - if (value != NULL) { - *((unsigned int *)ptr) = - strtoul(value, NULL, 10); - } + if (value != NULL && + str_to_uint(value, (unsigned int *)ptr) < 0) + i_error("sql: Value not uint: %s", value); break; } case SQL_TYPE_ULLONG: { - if (value != NULL) { - *((unsigned long long *)ptr) = - strtoull(value, NULL, 10); - } + if (value != NULL && + str_to_ullong(value, (unsigned long long *)ptr) < 0) + i_error("sql: Value not ullong: %s", value); break; } case SQL_TYPE_BOOL: {