Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows using wallpaper files without extensions #55

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix errors
  • Loading branch information
Vlad1-1 committed Mar 29, 2023
commit bd1f5499a34cb53f4c7acde1f1fa86be8c3b39e8
4 changes: 2 additions & 2 deletions src/render/WallpaperTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ void CWallpaperTarget::create(const std::string& path) {
const auto BEGINLOAD = std::chrono::system_clock::now();

cairo_surface_t* CAIROSURFACE = nullptr;
const auto len = path.len()+36;
const auto len = path.length()+36;
char cmd[len];
snprintf(cmd, len, "file -b --mime-type %s", path.c_str());
sprintf(cmd, "file -b --mime-type %s", path.c_str());
FILE *file = popen(cmd, "r");
char file_type[16];
fread(file_type, 1, 15, file);
Expand Down