News for hackers. Stuff that matters.
Re:Sj.h: A tiny little JSON parsing library in ~150 lines of... by oguz-ismail on Sunday September 21, 2025 @04:14PM (#45326243)

    diff --git a/sj.h b/sj.h
    index 60bea9e..25f6438 100644
    --- a/sj.h
    +++ b/sj.h
    @@ -85,6 +85,7 @@ top:
             return res;
     
         case '{': case '[':
    +        if (r->depth > 999) { r->error = "can't go deeper"; goto top; }
             res.type = (*r->cur == '{') ? SJ_OBJECT : SJ_ARRAY;
             res.depth = ++r->depth;
             r->cur++;
There, fixed it
Re:Sj.h: A tiny little JSON parsing library in ~150 lines of... by meindnoch on Sunday September 21, 2025 @06:45PM (#45327347)
I can only hope this was made by an LLM and not a real human.