MCPcopy Create free account
hub / github.com/eggert/tz / getoffset

Function getoffset

localtime.c:1462–1478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1460*/
1461
1462static const char *
1463getoffset(register const char *strp, int_fast32_t *const offsetp)
1464{
1465 register bool neg = false;
1466
1467 if (*strp == '-') {
1468 neg = true;
1469 ++strp;
1470 } else if (*strp == '+')
1471 ++strp;
1472 strp = getsecs(strp, offsetp);
1473 if (strp == NULL)
1474 return NULL; /* illegal time */
1475 if (neg)
1476 *offsetp = -*offsetp;
1477 return strp;
1478}
1479
1480/*
1481** Given a pointer into a timezone string, extract a rule in the form

Callers 2

getruleFunction · 0.85
tzparseFunction · 0.85

Calls 1

getsecsFunction · 0.85

Tested by

no test coverage detected