Git Product home page Git Product logo

Comments (6)

LinusDierheimer avatar LinusDierheimer commented on June 7, 2024

Can you post the content of the string after each operation? ffStrbufPutTo(&themeStrbuf, stdout); should help. Also how delStrs is declared.

ffStrbufRecalculateLength is not needed, as all strbuf functions always keep the length up to date. I use it only after i let a c function like sscanf write directly in the strbuf buffer. It simply sets the length to the index of the first '\0' char.

from fastfetch.

LinusDierheimer avatar LinusDierheimer commented on June 7, 2024

Update: ffStrbufTrimLeft actually didn't set the null byte at the end. Since i used only strbuf functions which use the length i never encountered an issue with that. But your call of ffStrbufRecalculateLength found the out dated null byte (before the trim) and therefore resized the strbuf to a wrong size. I fixed it just now to avoid bugs with functions that expect a null terminated string.

from fastfetch.

DarNCelsius avatar DarNCelsius commented on June 7, 2024
Original string: 		"    <name>Matcha-dark-azul</name>
"
    Matcha-dark-azul

    Matcha-dark-azul
MatcMatcha-dark-

I used recalculate just to see what was happening.
Interestingly, as you can see above, printf("Resulting string: \t\t %s\n", themeStrbuf.chars); is producing a different result than ffStrbufPutTo(&themeStrbuf, stdout);
They're both wrong though. ;)

edit: Ah, so it's fixed then. :)

from fastfetch.

LinusDierheimer avatar LinusDierheimer commented on June 7, 2024

They produce different results as ffStrbufPutTo writes exactly length bytes to the FILE buffer for better performance and printf searches a null byte which was not set.

from fastfetch.

LinusDierheimer avatar LinusDierheimer commented on June 7, 2024

ffStrbufTrimRight actually had a major bug i somehow was lucky to never encounter. Fixed with the latest commit.

from fastfetch.

DarNCelsius avatar DarNCelsius commented on June 7, 2024

Indeed it's fixed. GJ.

from fastfetch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.