MCPcopy Create free account
hub / github.com/GJDuck/e9patch / getAbsname

Function getAbsname

src/e9tool/e9misc.cpp:87–98  ·  view source on GitHub ↗

* Get the absolute source filename. */

Source from the content-addressed store, hash-verified

85 * Get the absolute source filename.
86 */
87const char *getAbsname(const char *dir, const char *file, char *tmp,
88 size_t size)
89{
90 if (dir == nullptr)
91 return file;
92 if (tmp == nullptr || size == 0)
93 return nullptr;
94 ssize_t r = snprintf(tmp, size-1, "%s/%s", dir, file);
95 if (r < 0 || (size_t)r >= size-1)
96 return nullptr;
97 return tmp;
98}
99
100/*
101 * Get the source directory name.

Callers 3

makeMatchValueFunction · 0.85
sendArgumentDataMetadataFunction · 0.85
getDirnameFunction · 0.85

Calls 1

snprintfFunction · 0.85

Tested by

no test coverage detected