Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Do not test len of None (#923)
Browse files Browse the repository at this point in the history
NAS-101531

Signed-off-by: Brandon Schneider <brandon@ixsystems.com>
  • Loading branch information
Brandon Schneider committed May 13, 2019
1 parent 36932e4 commit 207e0a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions iocage_lib/ioc_fstab.py
Expand Up @@ -463,6 +463,9 @@ def __fstab_encode__(self, _string):
Example: ' ' -> \040
"""
if _string is None:
return _string

result = ctypes.create_string_buffer(len(_string) * 4 + 1)
self.libc.strvis(
result, _string.encode(), 0x4 | 0x8 | 0x10 | 0x2000 | 0x8000
Expand All @@ -476,6 +479,9 @@ def __fstab_decode__(self, _string):
Example: \040 -> ' '
"""
if _string is None:
return _string

result = ctypes.create_string_buffer(len(_string) * 4 + 1)
self.libc.strunvis(
result, _string.encode(), 0x4 | 0x8 | 0x10 | 0x2000 | 0x8000
Expand Down

0 comments on commit 207e0a6

Please sign in to comment.