open-license-manager / licensecc

Software licensing, copy protection in C++. It has few dependencies and it's cross-platform.
http://open-license-manager.github.io/licensecc/
BSD 3-Clause "New" or "Revised" License
950 stars 303 forks source link

use #define(d) constants for all the fixed lenght arrays in the public api. #70

Closed gcontini closed 4 years ago

gcontini commented 4 years ago

Moving here a discussion from another bug for simplicity

  • in some structs (e.g., AuditEvent, CallerInformations, LicenseInfo), there are fixed-length arrays whose dimensions are not "#defined," but are instead manifest constant integers (e.g., "11"). There is also one case of an expression in the dimension (proprietary_data in LicenseInfo). These dimensions are thus unavailable as constants into the binding language. So when the binding language tries to set/get these fields, there is risk of manually getting the length wrong (especially if it changes later), and Bad Things may happen.
gcontini commented 4 years ago

fixed on develop branch