X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Ftoken.c;h=29dcb42657497bc1732bfa358f02d615c424324e;hp=95eaf7a6f765db9793198c5226be8233f66364af;hb=47dd00ab6df0a093b13d4f573ba01c79a6bcc72f;hpb=2fa436074ca9a5e87f39b696de832fa2188fcfc6 diff --git a/src/token.c b/src/token.c index 95eaf7a..29dcb42 100644 --- a/src/token.c +++ b/src/token.c @@ -91,7 +91,7 @@ struct psi_token *psi_token_cat(const char *sep, unsigned argc, ...) { T->type = PSI_T_NAME; T->file = zend_string_copy(T->file); - for (i = 0; i < argc; ++i) { + for (i = 1; i < argc; ++i) { struct psi_token *arg = va_arg(argv, struct psi_token *); if (sep_len && text.a) { @@ -173,7 +173,7 @@ static inline uint64_t psi_hash(char *digest_buf, ...) uint64_t psi_token_hash(struct psi_token *t, char *digest_buf) { char loc_buf[48]; - sprintf(digest_buf, "%u%u", t->line, t->col); + sprintf(loc_buf, "%u%u", t->line, t->col); return psi_hash(digest_buf, t->file->val, loc_buf, (char *) NULL); }