MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / date_get_num

Function date_get_num

libavutil/parseutils.c:455–477  ·  view source on GitHub ↗

get a positive number between n_min and n_max, for a maximum length of len_max. Return -1 if error. */

Source from the content-addressed store, hash-verified

453/* get a positive number between n_min and n_max, for a maximum length
454 of len_max. Return -1 if error. */
455static int date_get_num(const char **pp,
456 int n_min, int n_max, int len_max)
457{
458 int i, val, c;
459 const char *p;
460
461 p = *pp;
462 val = 0;
463 for(i = 0; i < len_max; i++) {
464 c = *p;
465 if (!av_isdigit(c))
466 break;
467 val = (val * 10) + c - '0';
468 p++;
469 }
470 /* no number read ? */
471 if (p == *pp)
472 return -1;
473 if (val < n_min || val > n_max)
474 return -1;
475 *pp = p;
476 return val;
477}
478
479static int date_get_month(const char **pp) {
480 int i = 0;

Callers 1

av_small_strptimeFunction · 0.85

Calls 1

av_isdigitFunction · 0.85

Tested by

no test coverage detected