File: str.c

package info (click to toggle)
libite 2.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,920 kB
  • sloc: sh: 4,463; ansic: 3,660; makefile: 111
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;
}