I think usage of snprintf is wrong. see here:
snprintf[
^]
the first parameter is buffer, the second parameter is the size of the first parameter(buffer size).
It should be like
snprintf(result,sizeof(result),"%%0%ullX", precision);
I tried the following example and it is OK.
#include <stdio.h>
int main() {
int i;
char buff[100];
i=snprintf(buff, sizeof(buff), "%d", 10);
if(i>0)
buff[i]=0;
printf("%s %d", buff, i);
return 0;
}
But I am not sure if your format string is correct ("%%0%ullX")