no need for allowed length
This commit is contained in:
@@ -165,8 +165,7 @@ extern void *DeepState_ConcretizeData(void *begin, void *end);
|
||||
|
||||
/* Assign a symbolic C string of length `len` with only chars in allowed,
|
||||
* if allowed is non-null */
|
||||
extern void DeepState_AssignCStr(char* str, size_t len, const char* allowed,
|
||||
size_t allowed_size);
|
||||
extern void DeepState_AssignCStr(char* str, size_t len, const char* allowed);
|
||||
|
||||
/* Return a symbolic C string of length `len`. */
|
||||
extern char *DeepState_CStr(size_t len);
|
||||
|
||||
@@ -472,10 +472,10 @@ struct Comparer {
|
||||
};
|
||||
|
||||
/* Like DeepState_AssignCStr, but Pumps through possible string sizes. */
|
||||
inline static void DeepState_AssignCStrMax(char* str, size_t max_len, const char* allowed,
|
||||
size_t allowed_size) {
|
||||
inline static void DeepState_AssignCStrMax(char* str, size_t max_len,
|
||||
const char* allowed) {
|
||||
uint32_t size = DeepState_UIntInRange(0, max_len);
|
||||
DeepState_AssignCStr(str, Pump(size, max_len), allowed, allowed_size);
|
||||
DeepState_AssignCStr(str, Pump(size, max_len), allowed);
|
||||
}
|
||||
|
||||
/* Like DeepState_CStr, but Pumps through possible string sizes. */
|
||||
|
||||
+2
-2
@@ -176,14 +176,14 @@ void *DeepState_ConcretizeData(void *begin, void *end) {
|
||||
}
|
||||
|
||||
/* Assign a symbolic C string of length `len`. */
|
||||
void DeepState_AssignCStr(char* str, size_t len, const char* allowed,
|
||||
size_t allowed_size) {
|
||||
void DeepState_AssignCStr(char* str, size_t len, const char* allowed) {
|
||||
if (SIZE_MAX == len) {
|
||||
DeepState_Abandon("Can't create an SIZE_MAX-length string.");
|
||||
}
|
||||
if (NULL == str) {
|
||||
DeepState_Abandon("Attempted to populate null pointer.");
|
||||
}
|
||||
uint32_t allowed_size = strlen(allowed);
|
||||
for (int i = 0; i < len; i++) {
|
||||
str[i] = allowed[DeepState_UIntInRange(0, allowed_size)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user