File: fmt_pb_type2_string.c

package info (click to toggle)
libowfat 0.34-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,288 kB
  • sloc: ansic: 20,181; makefile: 16
file content (10 lines) | stat: -rw-r--r-- 236 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
#include "fmt.h"
#include "rangecheck.h"
#include <string.h>

size_t fmt_pb_type2_string(char* dest,const char* s,size_t l) {
  size_t n=fmt_varint(dest,l);
  if (add_of(n,l,n)) return 0;
  if (dest) memcpy(dest+n-l,s,l);
  return n;
}