summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-02-23 20:09:22 +0000
committerGitHub <noreply@github.com>2023-02-23 20:09:22 +0000
commit69a7ae54d27513d7553b4d8bd77ade017e674e22 (patch)
tree61bf80abaef838056c7c4ea13fe1083aaee768a9
parentda035d6acee1e5a608aafe5f6572a67609b0198a (diff)
parent5b88266ce8a381c496d031cd46cc2f2fdf7ec8f8 (diff)
downloadpatchelf-69a7ae54d27513d7553b4d8bd77ade017e674e22.tar.gz
Merge #466
466: Adjust roundUp for 0 as input r=Mic92 a=cgzones Co-authored-by: Christian Göttsche <cgzones@googlemail.com>
-rw-r--r--src/patchelf.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc
index db18837..ca247c1 100644
--- a/src/patchelf.cc
+++ b/src/patchelf.cc
@@ -479,6 +479,8 @@ static void writeFile(const std::string & fileName, const FileContents & content
static uint64_t roundUp(uint64_t n, uint64_t m)
{
+ if (n == 0)
+ return m;
return ((n - 1) / m + 1) * m;
}