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

Function http_make_path

cups/tls-openssl.c:1628–1659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1626 */
1627
1628static const char * // O - Filename
1629http_make_path(
1630 char *buffer, // I - Filename buffer
1631 size_t bufsize, // I - Size of buffer
1632 const char *dirname, // I - Directory
1633 const char *filename, // I - Filename (usually hostname)
1634 const char *ext) // I - Extension
1635{
1636 char *bufptr, // Pointer into buffer
1637 *bufend = buffer + bufsize - 1; // End of buffer
1638
1639
1640 snprintf(buffer, bufsize, "%s/", dirname);
1641 bufptr = buffer + strlen(buffer);
1642
1643 while (*filename && bufptr < bufend)
1644 {
1645 if (_cups_isalnum(*filename) || *filename == '-' || *filename == '.')
1646 *bufptr++ = *filename;
1647 else
1648 *bufptr++ = '_';
1649
1650 filename ++;
1651 }
1652
1653 if (bufptr < bufend && filename[-1] != '.')
1654 *bufptr++ = '.';
1655
1656 strlcpy(bufptr, ext, (size_t)(bufend - bufptr + 1));
1657
1658 return (buffer);
1659}
1660
1661
1662//

Callers 5

httpLoadCredentialsFunction · 0.85
httpSaveCredentialsFunction · 0.85
_httpTLSStartFunction · 0.85
http_load_crlFunction · 0.85

Calls 1

_cups_isalnumFunction · 0.85

Tested by

no test coverage detected