mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2024-11-28 07:23:07 +01:00
Fix
This commit is contained in:
parent
f850b4b116
commit
ca85b5c017
@ -76,13 +76,11 @@ static int peekn_char(Lexer *ctx, unsigned int i)
|
||||
|
||||
if (i > 0) {
|
||||
assert(i < LEN(b->buf));
|
||||
memmove(b->buf, b->buf + (b->len - i) * sizeof(*b->buf),
|
||||
i * sizeof(*b->buf));
|
||||
memmove(b->buf, b->buf + (b->len - i), i * sizeof(*b->buf));
|
||||
}
|
||||
|
||||
b->pos = 0;
|
||||
b->len = fread(b->buf + i * sizeof(*b->buf), sizeof(*b->buf),
|
||||
LEN(b->buf) - i, b->f);
|
||||
b->len = fread(b->buf + i, sizeof(*b->buf), LEN(b->buf) - i, b->f);
|
||||
|
||||
if (b->len != LEN(b->buf)) {
|
||||
if (feof(b->f))
|
||||
@ -185,7 +183,7 @@ static int cmp_nextn(Lexer *ctx, int n, char *s)
|
||||
if (i >= n || *s == '\0' || c != *s)
|
||||
break;
|
||||
|
||||
s += sizeof(*s);
|
||||
s++;
|
||||
i++;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ char *prepend_helpers(char *str, size_t len)
|
||||
l = helpers_len;
|
||||
memcpy(b, scr_helpers_sh, l * sizeof(*b));
|
||||
|
||||
b += l * sizeof(*str);
|
||||
b += l;
|
||||
l = len;
|
||||
memcpy(b, str, l * sizeof(*b));
|
||||
|
||||
|
@ -136,7 +136,7 @@ const char *get_ext(const char *path)
|
||||
const char *base;
|
||||
|
||||
if ((base = strrchr(path, '/')))
|
||||
base += sizeof(*base);
|
||||
base++;
|
||||
else
|
||||
base = path;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user