Skip to content

Commit d8e6857

Browse files
committed
Fixed build
1 parent 7ef199a commit d8e6857

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/wsjcpp_core.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -612,26 +612,26 @@ std::string WsjcppCore::decodeUriComponent(const std::string& sValue) {
612612
// ---------------------------------------------------------------------
613613

614614
std::string WsjcppCore::getHumanSizeBytes(long nBytes) {
615-
if (nValue == 0) {
615+
if (nBytes == 0) {
616616
return "0B";
617617
}
618618
std::string arrPrefix[] = {"B", "KB", "MB", "GB", "TB", "PB"};
619-
long n0 = nValue;
619+
long n0 = nBytes;
620620
long n1 = 0;
621621
for (int i = 0; i < 6; i++) {
622622
if (n0 >= 1 && n0 < 1000) {
623623
return std::to_string(n0) + arrPrefix[i];
624624
}
625-
n0 = nValue / 1000;
626-
n1 = nValue - n0 * 1000;
625+
n0 = nBytes / 1000;
626+
n1 = nBytes - n0 * 1000;
627627
n0 += n1 >= 500 ? 1 : 0;
628628

629-
nValue = nValue / 1000;
629+
nBytes = nBytes / 1000;
630630
if (n0 == 0 && n1 == 0) {
631631
return "fuck";
632632
}
633633
}
634-
return std::to_string(nValue) + "PB";
634+
return std::to_string(nBytes) + "PB";
635635
}
636636

637637
// ---------------------------------------------------------------------

0 commit comments

Comments
 (0)