提交 01f45b2a 编写于 作者: B Benguang Zhao

enh: compatibility between getFileNamePrefix and tsdbTFileName

上级 6fbf2519
......@@ -112,7 +112,10 @@ static char* getFileNamePrefix(STsdb *pTsdb, SDiskID did, int32_t fid, uint64_t
p += titoa(TD_VID(pTsdb->pVnode), 10, p);
*(p++) = 'f';
p += titoa(fid, 10, p);
if (fid < 0) {
*(p++) = '-';
}
p += titoa((fid < 0) ? -fid : fid, 10, p);
memcpy(p, "ver", 3);
p += 3;
......
......@@ -351,10 +351,10 @@ int32_t titoa(uint64_t val, size_t radix, char str[]) {
int32_t i = 0;
uint64_t v = val;
while(v > 0) {
do {
buf[i++] = s[v % radix];
v /= radix;
}
} while (v > 0);
// reverse order
for(int32_t j = 0; j < i; ++j) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册