cee-studio / orca

C Multi-REST API library for Discord, Slack, Reddit, etc.

Home Page:https://cee-studio.github.io/orca/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A NULL NTL (null-terminated list) results in a invalid JSON if generated from spec

lcsmuller opened this issue · comments

The following JSON is generated (via dati_to_json) when a NTL (null-terminated list)

{
  "op":2,
  "d":{
    "token":"TOKEN",
    "properties": {
      "$os":"POSIX",
      "$browser":"orca",
      "$device":"orca"
    },
    "compress":false,
    "large_threshold":0,
    "presence": {
      "since":"2021-03-19T16:34:31.262Z",
      "activities":,
      "status":"online",
      "afk":false
    },
    "guild_subscriptions":false,
    "intents":13824
  }
}

As you can see from the activities field, that results in a invalid JSON that can't be interpreted by the receiver. If a NTL is NULL the resulting value should also be null or absent from the JSON.

commented

fixed.

commented

it will render null for NULL ntl.