Hello,
I've noticed quite big parts of libgcrypt use the following
constructions:
array = gcry_calloc (strlen (elems) + 1, sizeof (*array));
if (! array)
err = gpg_err_code_from_errno (errno);
But how can you be sure that calloc() (or in that case gcry_calloc)
will set the errno? calloc is a library call which may or may not use
a system call. Even if it works on some systems, this is a very
non-portable construction, which will result in no error checking in
systems that do not set errno.
_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
I've noticed quite big parts of libgcrypt use the following
constructions:
array = gcry_calloc (strlen (elems) + 1, sizeof (*array));
if (! array)
err = gpg_err_code_from_errno (errno);
But how can you be sure that calloc() (or in that case gcry_calloc)
will set the errno? calloc is a library call which may or may not use
a system call. Even if it works on some systems, this is a very
non-portable construction, which will result in no error checking in
systems that do not set errno.
_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel