base-files: fix offset conversion on caldata_patch_data()
authorShiji Yang <yangshiji66@qq.com>
Sat, 8 Feb 2025 07:36:24 +0000 (15:36 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 12 Feb 2025 23:32:30 +0000 (00:32 +0100)
commitbccab05ac71e9d4ebec321dba997336e7ddff249
tree8c05a48a48c5e1f29674268d6724fcca20752a76
parent9b05ca988c3a778c42d12dd34d9f7aa56c953cb6
base-files: fix offset conversion on caldata_patch_data()

`$(( ))` will convert uninitialized variable to "0". If we want to
use "-n" to check the string length, it's necessary to make sure the
converted variable is not empty.

Fixes: 652a6677d5fa ("base-files: Add new functions for ath11k caldata")
Fixes: https://github.com/openwrt/openwrt/issues/17818
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/17892
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 094b6f593fb4943005e13e2f8581e66bb7c2c8cf)
package/base-files/files/lib/functions/caldata.sh