X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Finternal%2Fshgetc.h;h=9435381a61d1ee45c373c87bf7bcb5b43b370676;hb=2f2348c9588d61680123bbe438db38acf5dfea4c;hp=1c30f75f4bad2564391c2e0fb1bff2b0b34b8883;hpb=d6c855caa88ddb1ab6e24e23a14b1e7baf4ba9c7;p=musl diff --git a/src/internal/shgetc.h b/src/internal/shgetc.h index 1c30f75f..9435381a 100644 --- a/src/internal/shgetc.h +++ b/src/internal/shgetc.h @@ -26,7 +26,7 @@ hidden int __shgetc(FILE *); #define shcnt(f) ((f)->shcnt + ((f)->rpos - (f)->buf)) #define shlim(f, lim) __shlim((f), (lim)) #define shgetc(f) (((f)->rpos != (f)->shend) ? *(f)->rpos++ : __shgetc(f)) -#define shunget(f) ((f)->shend ? (void)(f)->rpos-- : (void)0) +#define shunget(f) ((f)->shlim>=0 ? (void)(f)->rpos-- : (void)0) #define sh_fromstring(f, s) \ ((f)->buf = (f)->rpos = (void *)(s), (f)->rend = (void*)-1)