rem: sprintf(buffer, "%u", mask);
add: snprintf(buffer, sizeof(buffer), "%u", mask);
context: makeWindowState(WWindow *wwin, WApplication *wapp){    WScreen *scr = wwin->screen_ptr;    Window win;    int argc;    char **argv;    int i;    unsigned mask;    char *class, *instance, *command=NULL, buffer[256];    proplist_t win_state, cmd, name, workspace;    proplist_t shaded, miniaturized, hidden, geometry;    proplist_t dock, shortcut;    if (wwin->main_window!=None && wwin->main_window!=wwin->client_win)        win = wwin->main_window;    else        win = wwin->client_win;    if (XGetCommand(dpy, win, &argv, &argc) && argc>0) {        command = wtokenjoin(argv, argc);        XFreeStringList(argv);    }    if (!command)        return NULL;    if (PropGetWMClass(win, &class, &instance)) {        if (class && instance)            sprintf(buffer, "%s.%s", instance, class);        else if (instance)            sprintf(buffer, "%s", instance);        else if (class)            sprintf(buffer, ".%s", class);        else            sprintf(buffer, ".");        name = PLMakeString(buffer);        cmd = PLMakeString(command);        /*sprintf(buffer, "%d", wwin->frame->workspace+1);        workspace = PLMakeString(buffer);*/        workspace = PLMakeString(scr->workspaces[wwin->frame->workspace]->name);        shaded = wwin->flags.shaded ? sYes : sNo;        miniaturized = wwin->flags.miniaturized ? sYes : sNo;        hidden = wwin->flags.hidden ? sYes : sNo;        sprintf(buffer, "%ix%i+%i+%i", wwin->client.width, wwin->client.height,		wwin->frame_x, wwin->frame_y);        geometry = PLMakeString(buffer);		for (mask = 0, i = 0; i < MAX_WINDOW_SHORTCUTS; i++) {	    if (scr->shortcutWindows[i] != NULL &&		WMGetFirstInArray(scr->shortcutWindows[i], wwin) != WANotFound) {		mask |= 1<<i;	    }	}	sprintf(buffer, "%u", mask);	shortcut = PLMakeString(buffer);        win_state = PLMakeDictionaryFromEntries(sName, name,                                                sCommand, cmd,                                                sWorkspace, workspace,                                                sShaded, shaded,                                                sMiniaturized, miniaturized,                                                sHidden, hidden,						sShortcutMask, shortcut,                                                sGeometry, geometry,                                                NULL);        PLRelease(name);        PLRelease(cmd);        PLRelease(workspace);        PLRelease(geometry);	PLRelease(shortcut);        if (wapp && wapp->app_icon && wapp->app_icon->dock) {            int i;            char *name;            if (wapp->app_icon->dock == scr->dock) {                name="Dock";            } else {                for(i=0; i<scr->workspace_count; i++)                    if(scr->workspaces[i]->clip == wapp->app_icon->dock)                        break;                assert( i < scr->workspace_count);                /*n = i+1;*/                name = scr->workspaces[i]->name;            }            dock = PLMakeString(name);            PLInsertDictionaryEntry(win_state, sDock, dock);            PLRelease(dock);        }    } else {        win_state = NULL;    }    if (instance) XFree(instance);    if (class) XFree(class);    if (command) wfree(command);    return win_state;}