GIT.Harvie.CZ
/
mirrors
/
Programs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
voltage note
[mirrors/Programs.git]
/
c
/
winsize.c
diff --git
a/c/winsize.c
b/c/winsize.c
index 03c1f7ce1155ba27bb110b1b27614dfbeead6006..e76de716f75ff95560c3bd091af537ebcba45ab5 100644
(file)
--- a/
c/winsize.c
+++ b/
c/winsize.c
@@
-1,14
+1,17
@@
+/*
+ * Prints size of terminal window in characters
+ */
+
#include <stdio.h>
#include <sys/ioctl.h>
static int get_win_size (int fd, struct winsize *win)
{
#include <stdio.h>
#include <sys/ioctl.h>
static int get_win_size (int fd, struct winsize *win)
{
- int err = ioctl (fd, TIOCGWINSZ, (char *) win);
- return err;
+ return ioctl (fd, TIOCGWINSZ, (char *) win);
}
int main(void) {
struct winsize win;
}
int main(void) {
struct winsize win;
- if(!get_win_size(1, &win)) puts("
Chyba
!");
+ if(!get_win_size(1, &win)) puts("
Error
!");
printf("%d %d :-)\n", win.ws_row, win.ws_col);
}
printf("%d %d :-)\n", win.ws_row, win.ws_col);
}
This page took
0.212139 seconds
and
4
git commands to generate.