lib/pcre/UniqueRegex: use libfmt
This commit is contained in:
parent
00d5e6e9c7
commit
c8f54b3509
@ -4,8 +4,7 @@
|
||||
|
||||
#include "UniqueRegex.hxx"
|
||||
#include "Error.hxx"
|
||||
|
||||
#include <stdio.h>
|
||||
#include "lib/fmt/ToBuffer.hxx"
|
||||
|
||||
void
|
||||
UniqueRegex::Compile(const char *pattern, bool anchored, bool capture,
|
||||
@ -28,8 +27,7 @@ UniqueRegex::Compile(const char *pattern, bool anchored, bool capture,
|
||||
&error_number, &error_offset,
|
||||
nullptr);
|
||||
if (re == nullptr) {
|
||||
char msg[256];
|
||||
snprintf(msg, sizeof(msg), "Error in regex at offset %zu",
|
||||
const auto msg = FmtBuffer<256>("Error in regex at offset {}",
|
||||
error_offset);
|
||||
throw Pcre::MakeError(error_number, msg);
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ pcre = static_library(
|
||||
include_directories: inc,
|
||||
dependencies: [
|
||||
pcre_dep,
|
||||
fmt_dep,
|
||||
],
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user