wedesoft/anymeal

Undefined behavior when having longer recipe titles

Closed this issue · 2 comments

Undefined behavior when having character ž in recipe title:
How to reproduce:

  1. option: Set aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa as title of the recipe and then click on button Show all recipes.
  2. option: Create new recipe with name containing 8 "ž" characters and then click on button Show all recipes
    8ž = recipes.servings
    9
    ž = recipes.servingsun
    .
    .
    .
    16*ž = ����2e

Thanks for reporting this bug. Looks like I was using the return value of recipe.title().c_str() beyond it's lifetime!

Ok, fixed in version 1.31.