MCPcopy Create free account
hub / github.com/OpenPrinting/cups / _cups_strncasecmp

Function _cups_strncasecmp

cups/string.c:647–672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

645 */
646
647int /* O - Result of comparison (-1, 0, or 1) */
648_cups_strncasecmp(const char *s, /* I - First string */
649 const char *t, /* I - Second string */
650 size_t n) /* I - Maximum number of characters to compare */
651{
652 while (*s != '\0' && *t != '\0' && n > 0)
653 {
654 if (_cups_tolower(*s) < _cups_tolower(*t))
655 return (-1);
656 else if (_cups_tolower(*s) > _cups_tolower(*t))
657 return (1);
658
659 s ++;
660 t ++;
661 n --;
662 }
663
664 if (n == 0)
665 return (0);
666 else if (*s == '\0' && *t == '\0')
667 return (0);
668 else if (*s != '\0')
669 return (1);
670 else
671 return (-1);
672}
673
674
675#ifndef HAVE_STRLCAT

Callers 15

token_cbFunction · 0.85
list_ppdsFunction · 0.85
load_drvFunction · 0.85
load_ppdFunction · 0.85
regex_device_idFunction · 0.85
cupsdAddNameMaskFunction · 0.85
auth.cFile · 0.85
cupsdFindBestFunction · 0.85
cupsdIsAuthorizedFunction · 0.85
cupsdReadClientFunction · 0.85
cupsdSendHeaderFunction · 0.85
check_if_modifiedFunction · 0.85

Calls 1

_cups_tolowerFunction · 0.85

Tested by 3

mainFunction · 0.68
check_constraintsFunction · 0.68
check_sizesFunction · 0.68