MCPcopy Create free account
hub / github.com/LASzip/LASzip / buildMessage

Function buildMessage

src/lasmessage.cpp:85–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void buildMessage(char *buffer, LAS_MESSAGE_TYPE type, LAS_FORMAT_STRING(const char*) fmt, va_list args) {
86 int len = vsnprintf(buffer, LAS_MAX_MESSAGE_LENGTH, fmt, args);
87 if (len > LAS_MAX_MESSAGE_LENGTH) { // avoid buffer overflow. messages longer than LAS_MAX_MESSAGE_LENGTH should not occur!
88 fprintf(stderr, "INTERNAL: message cropped from %d to %d chars", len, LAS_MAX_MESSAGE_LENGTH);
89 len = LAS_MAX_MESSAGE_LENGTH;
90 }
91 // remove trailing line feed
92 while (len > 0 && buffer[len - 1] == '\n') {
93 buffer[len - 1] = '\0';
94 --len;
95 }
96}
97
98void LASMessage(LAS_MESSAGE_TYPE type, LAS_FORMAT_STRING(const char*) fmt, ...) {
99 assert(type <= LAS_FATAL_ERROR); // message type must be less than or equal to LAS_FATAL_ERROR (LAS_QUIET must not be used in LASMessage calls)

Callers 2

LASMessageFunction · 0.85
LASMessageExtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected