File: req_arg.c

package info (click to toggle)
bglibs 2.04%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,368 kB
  • sloc: ansic: 15,820; perl: 674; sh: 64; makefile: 26
file content (11 lines) | stat: -rw-r--r-- 347 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
#include "client.h"

int vclient_req_arg(vclient_req* vr, const str* arg)
{
  if (1 + vr->data.len + 2 + arg->len > VCLIENT_MAXLEN) return 0;
  if (!str_catc(&vr->data, (unsigned char)(arg->len >> 8))) return 0;
  if (!str_catc(&vr->data, (unsigned char)(arg->len))) return 0;
  if (!str_cat(&vr->data, arg)) return 0;
  ++vr->args;
  return 1;
}