File size: 320 Bytes
8df6da4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Copyright (C) 2016, Red Hat Inc, Andrew Jones <drjones@redhat.com>
 *
 * This work is licensed under the terms of the GNU LGPL, version 2.
 */
#include <libcflat.h>
#include "util.h"

int parse_keyval(char *s, long *val)
{
	char *p;

	p = strchr(s, '=');
	if (!p)
		return -1;

	*val = atol(p+1);
	return p - s;
}