TALLOC_CTX *mem_ctx,
struct ldb_dn_component *src)
{
- struct ldb_dn_component dst;
-
- memset(&dst, 0, sizeof(dst));
+ struct ldb_dn_component dst = {};
if (src == NULL) {
return dst;
TALLOC_CTX *mem_ctx,
struct ldb_dn_ext_component *src)
{
- struct ldb_dn_ext_component dst;
-
- memset(&dst, 0, sizeof(dst));
+ struct ldb_dn_ext_component dst = {};
if (src == NULL) {
return dst;
*/
time_t ldb_string_to_time(const char *s)
{
- struct tm tm;
+ struct tm tm = {};
time_t t;
if (s == NULL) return 0;
- memset(&tm, 0, sizeof(tm));
if (sscanf(s, "%04u%02u%02u%02u%02u%02u.0Z",
&tm.tm_year, &tm.tm_mon, &tm.tm_mday,
&tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
*/
time_t ldb_string_utc_to_time(const char *s)
{
- struct tm tm;
+ struct tm tm = {};
if (s == NULL) return 0;
- memset(&tm, 0, sizeof(tm));
if (sscanf(s, "%02u%02u%02u%02u%02u%02uZ",
&tm.tm_year, &tm.tm_mon, &tm.tm_mday,
&tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
ok = hex_byte(&str[i+1], &c);
if (!ok) {
talloc_free(ret.data);
- memset(&ret, 0, sizeof(ret));
- return ret;
+ return (struct ldb_val){};
}
((uint8_t *)ret.data)[j++] = c;
i += 2;