Hi,
I was cleaning up my computer yesterday when I stumbled upon
some diffs. It seems that I forgot to send them, so I rebased
them and here they are.

1. Just an uninitialized variable
2. Since sysctl() returns -1 when failing, we should check
   for 0

Ok/Comments?
diff --git a/src/lib/ecore_con/ecore_con_ssl.c b/src/lib/ecore_con/ecore_con_ssl.c
index 09a0894..51b9129 100644
--- a/src/lib/ecore_con/ecore_con_ssl.c
+++ b/src/lib/ecore_con/ecore_con_ssl.c
@@ -94,7 +94,7 @@ _gnutls_log_func(int         level,
                  const char *str)
 {
    char buf[128];
-   strncat(buf, str, strlen(str) - 1);
+   strncpy(buf, str, strlen(str) - 1);
    DBG("|<%d>| %s", level, buf);
 }
 #endif
diff --git a/src/modules/battery/e_mod_openbsd.c b/src/modules/battery/e_mod_openbsd.c
index 2876fb1..3da4bed 100644
--- a/src/modules/battery/e_mod_openbsd.c
+++ b/src/modules/battery/e_mod_openbsd.c
@@ -119,7 +119,7 @@ _battery_openbsd_battery_update()
             bat->last_full_charge = (double)s.value;
          }
     
-       /* remaining capcity */
+       /* remaining capacity */
        bat->mib[3] = 8;
        bat->mib[4] = 3;
        if (sysctl(bat->mib, 5, &s, &slen, NULL, 0) != -1)
@@ -161,7 +161,7 @@ _battery_openbsd_battery_update()
        /* battery state 1: discharge, 2: charge */
        bat->mib[3] = 10;
        bat->mib[4] = 0;
-       if (sysctl(bat->mib, 5, &s, &slen, NULL, 0) == -1)
+       if (sysctl(bat->mib, 5, &s, &slen, NULL, 0) != -1)
          {
             if (s.value == 2)
               bat->charging = 1;
@@ -175,7 +175,7 @@ _battery_openbsd_battery_update()
        /* AC State */
        ac->mib[3] = 9;
        ac->mib[4] = 0;
-       if (sysctl(ac->mib, 5, &s, &slen, NULL, 0) == -1)
+       if (sysctl(ac->mib, 5, &s, &slen, NULL, 0) != -1)
          {
             if (s.value)
               ac->present = 1;
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to