if (i->cnt)
fwrite(i->cnt, 1, i->cntl, out);
- fprintf(out, "((const char*) %u)", i->idx);
+ /* We offset all indexes by one, to avoid clashes
+ * between index 0 and NULL */
+ fprintf(out, "((const char*) %u)", i->idx+1);
}
}
"#define STRPOOL\n"
"#endif\n"
"#ifndef _P\n"
- "#define _P(x) (_strpool_ + ((x) - (const char*) 0))\n"
+ "#define _P(x) (_strpool_ + ((x) - (const char*) 1))\n"
"#endif\n\n");