Comments (6)
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.
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.
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.
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.
ffStrbufTrimRight actually had a major bug i somehow was lucky to never encounter. Fixed with the latest commit.
from fastfetch.
Indeed it's fixed. GJ.
from fastfetch.
Related Issues (20)
- [FEAT] Make bar monochrome
- [BUG] iterm logo does not work in Mintty / Git Bash terminal HOT 1
- [FEAT] output stdout like neofetch? HOT 1
- [FEAT] Add support for guix package manager HOT 1
- [FEAT] Allow no logo to be shown HOT 2
- [FEAT] Init system HOT 2
- [BUG] Error: GPU detection failed on Android (Termux). HOT 10
- [BUG] xonsh shell detected as "Python" HOT 3
- [Question] Detect macOS yabai(Window manager) HOT 10
- [FEAT] Json export HOT 4
- Strange strings behaviour on kitty terminal (Fedora Bluefin) [BUG] HOT 4
- [FEAT] Make guix package manager detection faster HOT 19
- [FEAT] Added newline after modules print HOT 3
- [BUG] colors on macos terminal.app are wrong
- [FEAT] Detect cache amounts for CPUs. HOT 3
- [FEAT] Detect GDDR VRAM type for dedicated GPUs. HOT 2
- [BUG] "fastfetch -s shell --format json" return "fastfetch" instead of "bash" or "zsh" HOT 8
- [BUG] Crashes(SIGSEGV) When trying To Get Init System On Türkçe Language HOT 31
- [BUG] [Pedantic] GNOME is capitalized incorrectly.
- Add TUXEDO OS HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastfetch.