File: str.c

package info (click to toggle)
libite 2.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,188 kB
  • sloc: sh: 4,665; ansic: 4,165; makefile: 141
file content (27 lines) | stat: -rw-r--r-- 388 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "../src/strlite.h"

int main(void)
{
	char buf[10];
	int val;

	val = atonum("42");
	if (val != 42)
		return 1;

	if (!string_match("eth1", "eth1234"))
		return 1;

	if (string_compare("eth1", "eth1234"))
		return 1;

	if (!string_case_compare("somestring", "SoMeSTRING"))
		return 1;

	strlcpy(buf, "tooloongstring", sizeof(buf));
	if (buf[9] == 'r')
		return 1;

	return 0;
}