summaryrefslogtreecommitdiffstats
path: root/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'common.go')
-rw-r--r--common.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/common.go b/common.go
index 310da86..2d73189 100644
--- a/common.go
+++ b/common.go
@@ -30,10 +30,10 @@ func readLimitedLine(br *bufio.Reader, length int) ([]byte, error) {
}
}
-func getInt(m *Message, param string) (int64, error) {
+func getInt(m *Message, param string, fallback int64) (int64, error) {
p := m.Param(param)
if p == "" {
- return 0, nil
+ return fallback, nil
}
n, err := strconv.ParseUint(p, 10, 63)
if err != nil || (n != 0 && p[0] == '0') || (n == 0 && len(p) != 1) {