Greetings,
Looking at crypt.c and crypt.h, I was wondering whether having
different-size crypt_data structures was intentional, and if
so, for what reason. At the moment, the declarations are (and see
also the attached code):
<crypt.h>
struct crypt_data {
int initialized;
char __buf[256];
}; /* 260 bytes when sizeof(int)==4 */
<crypt.c>
char *__crypt_r(const char *, const char *, struct crypt_data *);
char *crypt(const char *key, const char *salt)
{
static char buf[128];
return __crypt_r(key, salt, (struct crypt_data *)buf);
/* when sizeof(int)==4, this leaves __buf with 124 bytes. */
}
On that note: since the initialized member is (currently)
never referenced by name, adding a comment about that to the code
might help readers who are yet to be initiated:)
Best regards,
Zvi