Skip to content

Domain generator indexing off by one #18

@chriselgee

Description

@chriselgee

word1_idx = random.randint(1,len(words))

word2_idx = random.randint(1,len(words))

Problem: In a 100-line wordlist, this indexes lines 1 though 100. It should index 0 through 99. As written, when 100 is chosen, the function fails.
Recommended fix:

word1_idx = random.randint(0,len(words)-1)
word2_idx = random.randint(0,len(words)-1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions