File: netstring.cc

package info (click to toggle)
nullmailer 1%3A1.03-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,524 kB
  • ctags: 695
  • sloc: cpp: 4,484; sh: 4,123; makefile: 224; perl: 184
file content (13 lines) | stat: -rw-r--r-- 265 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "config.h"
#include "netstring.h"
#include "itoa.h"

mystring str2net(const mystring& s)
{
  return mystringjoin(itoa(s.length())) + ":" + s + ",";
}

mystring strnl2net(const mystring& s)
{
  return mystringjoin(itoa(s.length()+1)) + ":" + s + "\012,";
}