Skip to content

ffStrbufRemoveStrings() functions are order dependent #47

Closed

Description

@DarNCelsius

Original string: AMD Ryzen 7 3800X 8-Core Processor

With the current string array in cpu.c, ffStrbufRemoveStringsA() only removes 8-Core in the above string:

    const char* removeStrings[] = {
        "(R)", "(r)", "(TM)", "(tm)",
        " CPU", " FPU", " APU", " Processor",
        " Dual-Core", " Quad-Core", " Six-Core", " Eight-Core", " Ten-Core",
        " 2-Core", " 4-Core", " 6-Core", " 8-Core", " 10-Core", " 12-Core", " 14-Core", " 16-Core"
    };

Rearranging it to

    const char* removeStrings[] = {
        "(R)", "(r)", "(TM)", "(tm)",
        " Dual-Core", " Quad-Core", " Six-Core", " Eight-Core", " Ten-Core",
        " 2-Core", " 4-Core", " 6-Core", " 8-Core", " 10-Core", " 12-Core", " 14-Core", " 16-Core",
        " CPU", " FPU", " APU", " Processor"
    };

removes the proper strings.

ffStrbufRemoveStrings(&namePretty, 2, " Processor", " 8-Core");

removes 8-Core

ffStrbufRemoveStrings(&namePretty, 2, " 8-Core", " Processor");

removes 8-Core and Processor

Activity

  1. added
    bug
    on May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions