1 /* 2 * Copyright (C) 2016, Red Hat Inc, Andrew Jones <drjones@redhat.com> 3 * 4 * This work is licensed under the terms of the GNU LGPL, version 2. 5 */ 6 #include <libcflat.h> 7 8 int parse_keyval(char *s, long *val) 9 { 10 char *p; 11 12 p = strchr(s, '='); 13 if (!p) 14 return -1; 15 16 *val = atol(p+1); 17 return p - s; 18 } 19