-
-
Save zdi-team/c8285ad8d6777111bb0a830d9d44ae9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ad_setdate(struct adouble *ad, unsigned int dateoff, uint32_t date) | |
{ | |
bool xlate = (dateoff & AD_DATE_UNIX); | |
char *p = NULL; | |
p = ad_get_entry(ad, ADEID_FILEDATESI); | |
if (p == NULL) { | |
return -1; | |
} | |
dateoff &= AD_DATE_MASK; | |
if (xlate) { | |
date = AD_DATE_FROM_UNIX(date); | |
} | |
if (dateoff > AD_DATE_ACCESS) { | |
return -1; | |
} | |
memcpy(p + dateoff, &date, sizeof(date)); // overflow 3 bytes | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment