From 3b6dc85ef5c8ed5d735c425086639723a7a2690e Mon Sep 17 00:00:00 2001 From: Igor Dzuro Date: Fri, 27 Mar 2020 03:39:01 +0100 Subject: [PATCH] du3 --- du3/program | Bin 0 -> 16808 bytes du3/program.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100755 du3/program create mode 100644 du3/program.c diff --git a/du3/program b/du3/program new file mode 100755 index 0000000000000000000000000000000000000000..92fd8f075889fed413e4784308ff8ae6f1828c30 GIT binary patch literal 16808 zcmeHOeQXrR6`#Aq*aSG64^s!4dP}itTKO;#922128J}5K23%r8(gfCL-`T#_cW2%0 zH8yQjt0t&d;*?fVm4719R;n5mRaE__Rlh(WN>Zr}k*cCLNNxm@p{Zi}ft*%w{k_?F z=iT)=Ql%LLE1!(g@jc>L<)!*GA|q+?T9U(LfW*?yqo&L>$zn0H$0_?%ePc>8k5uB#Dc+pov7A=* zvE+DCOz3l2`E$#5lu=?ywv@VWnQ_W%8fgpVZVMJHnfDp+RH&83`wI^HVO8H^aj8@7 zXQ{d?wu~hETOQpq5^owwrt@P>W34SsEsutBnb0=bZ}LyJ`w#ZYhS2!p&{CV%;zJmf z_rG)FgN;yv%occ+-V(va(+$$*WAX?8}KP-9|FFyj6HRDm3UZmhpj>$ zZvyvYfWqG*M)PJ)rVlFbrZFIWv|u zjZ_T8{au}H`;2X&ZJ`~)=vGvONd(jbze^o>>0~F^5u_v|<{TX<0*R ztzZ6GH> z$7$Mz(|F`GW5eZpN)^o7@Jcp@oU`FHZaMLNA|EtvIn{-&9QmNJ&PfYfIl}qbCZsV; zS0M!j0E z_x5?Ie+ByB8R#-?{cC68+Ht+`wmx}tw!5cms^SiO=~F8wrPy;3R>j&DaQ;zU-%cfa zz5zv_s`wg-opWX_njfS*n!l_#U0pvxjxQ+*`??Bzn=NogJMxHMCbI$=jKFy4ceOu!tqOh ze*zQnm$W|BdzL8r)Q%X6i1fV$q*fvsCDP8*(Q}g*DhttbC3fMOK2@v1tW9 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xW((_(NQHN;ZM0aTwc$uk;9cRYl!ix3`<6o!1c=k345 zXuW_}0N(Ld;`ts+UN5L(Y0G(%AH#>{=*;JNAxjNq_QdZ&#%(#>xN zeh+hYuAk?bEE^S%*EPI;V7CX6p*0Nic|OXrih_eg>mbT9pVu2lfYDlk`8;oBc@|~% zq}-LD<+fqwcH~&{CvGe;h%akQQKkR_x#`&|IF^+dN<8bI5Lc)>-}@ z+-e)2=kc@ZoHpCRL?+f*{uwBZJ+7bELwwGAnmUKXR09#8CT{n_Wy%8lt}W}lYqJmD~Ek5@Z^VXDfgS-zw~@?+Z9!ct1Xsx)a9J(Wm}pi Qm*dy(v@9xJ1eYrQ1M_K{m;e9( literal 0 HcmV?d00001 diff --git a/du3/program.c b/du3/program.c new file mode 100644 index 0000000..608d9ea --- /dev/null +++ b/du3/program.c @@ -0,0 +1,32 @@ +#define __USE_XOPEN +#define _GNU_SOURCE + +#include +#include +#include + +int main() { + char buffer[20]; + struct tm tm; + + char *retval = fgets(buffer, sizeof(buffer), stdin); + + if (retval == 0) { + puts("Neplatny datum"); + return 0; + } + + retval = strptime(buffer, "%e.%m.%-Y", &tm); + + if (retval == 0) { + puts("Neplatny datum"); + return 0; + } + + tm.tm_mday += 7; + + strftime(buffer, sizeof(buffer), "%e.%m.%-Y", &tm); + puts(buffer); + + return 0; +} \ No newline at end of file