Skip to content

Commit

Permalink
Merge branch 'develop' into feature/trace
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Chan committed Apr 28, 2024
2 parents 5fdeabc + 40c9b2f commit 8f14210
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
workflow_dispatch:
inputs:
skf-api-version:
description: "major/minor/patch or semver or none if not updating derive crate"
description: "skf-api: major/minor/patch or semver or none if not updating derive crate"
required: false
default: "none"
skf-rs-version:
description: "major/minor/patch or semver or none if not updating derive crate"
description: "skf-rs: major/minor/patch or semver or none if not updating derive crate"
required: false
default: "none"

Expand Down
2 changes: 1 addition & 1 deletion skf-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "skf-rs"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
authors = [
"CJ <power4j@outlook.com>",
Expand Down
6 changes: 6 additions & 0 deletions skf-rs/src/engine/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ impl FileManager for SkfAppImpl {
return Err(Error::Skf(SkfErr::of_code(ret)));
}
trace!("[SKF_EnumFiles]: desired len = {}", len);
if len == 0 {
return Ok(vec![]);
}
let mut buff = Vec::<CHAR>::with_capacity(len as usize);
let ret = unsafe { func(self.handle, buff.as_mut_ptr(), &mut len) };
trace!("[SKF_EnumFiles]: ret = {}", ret);
Expand Down Expand Up @@ -331,6 +334,9 @@ impl ContainerManager for SkfAppImpl {
return Err(Error::Skf(SkfErr::of_code(ret)));
}
trace!("[SKF_EnumContainer]: desired len = {}", len);
if len == 0 {
return Ok(vec![]);
}
let mut buff = Vec::<CHAR>::with_capacity(len as usize);
let ret = unsafe { func(self.handle, buff.as_mut_ptr(), &mut len) };
trace!("[SKF_EnumContainer]: ret = {}", ret);
Expand Down
3 changes: 3 additions & 0 deletions skf-rs/src/engine/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ impl AppManager for SkfDeviceImpl {
return Err(Error::Skf(SkfErr::of_code(ret)));
}
trace!("[SKF_EnumApplication]: desired len = {}", len);
if len == 0 {
return Ok(vec![]);
}
let mut buff = Vec::<CHAR>::with_capacity(len as usize);
let ret = unsafe { func(self.handle, buff.as_mut_ptr(), &mut len) };
trace!("[SKF_EnumApplication]: ret = {}", ret);
Expand Down
3 changes: 3 additions & 0 deletions skf-rs/src/engine/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ impl DeviceManager for ManagerImpl {
return Err(Error::Skf(SkfErr::of_code(ret)));
}
trace!("[SKF_EnumDev]: desired len = {}", len);
if len == 0 {
return Ok(vec![]);
}
let mut buff = Vec::<CHAR>::with_capacity(len as usize);
let ret = unsafe { func(presented_only as BOOL, buff.as_mut_ptr(), &mut len) };
trace!("[SKF_EnumDev]: ret = {}", ret);
Expand Down

0 comments on commit 8f14210

Please sign in to comment.